提交 9cf70709 authored 作者: Matrix's avatar Matrix

修改了resultObj

上级 1c28e42a
......@@ -132,6 +132,7 @@ public class DeviceCheckController {
.parse2Bto();
provStatTask.getInvolveUserIdList().add(AuthenticationUtils.getAuthentication().getCurrentUserInfo().getUserId());
provStatTask.getInvolveUserIdList().add(-1);
provStatTask.setCurrentPoint(1);
provStatTask = taskService.start(provStatTask).parse2Bto();
// 3 构建被查单位的 自查账单 与 自查任务
......@@ -190,7 +191,7 @@ public class DeviceCheckController {
*/
@ApiOperation(value = "专管员B核查详情单")
@PutMapping("/detail/B/{id}")
public ResponseEntity checkUserA(@PathVariable Integer id,
public ResponseEntity checkUserB(@PathVariable Integer id,
@RequestParam int checkStatus,
@RequestParam(required = false, defaultValue = "0") int checkUserAId,
@RequestParam(required = false, defaultValue = "0") int checkUserBId) {
......
......@@ -13,8 +13,10 @@ import com.tykj.dev.device.user.subject.dao.AreaDao;
import com.tykj.dev.device.user.subject.dao.UnitsDao;
import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.exception.ApiException;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
......@@ -80,7 +82,7 @@ public class ObjTransUtil {
//不为空则拼接
String checkDetailString = inLibString;
if (!CollectionUtils.isEmpty(notInLibrary)) {
checkDetailString = checkDetailString + notInLibString;
checkDetailString = checkDetailString + "," + notInLibString;
}
return checkDetailString;
}
......@@ -114,7 +116,8 @@ public class ObjTransUtil {
String[] array = detail.split("-");
Integer deviceId = Integer.valueOf(array[0]);
int proofResult = Integer.parseInt(array[1]);
DeviceLibrary device = deviceRepo.findById(deviceId).orElse(null);
DeviceLibrary device = deviceRepo.findById(deviceId).orElseThrow(
() -> new ApiException(ResponseEntity.badRequest().body(String.format("检查到装备序号为%d的装备不在库资料中,请先执行入库操作!", deviceId))));
//依据proofResult 判断是否是在库装备
if (proofResult == 3) {
// 非在库装备
......
......@@ -6,8 +6,8 @@ import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.repository.TaskLogDao;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.common.StatusEnum;
import com.tykj.dev.device.task.subject.common.GlobalMap;
import com.tykj.dev.device.task.subject.common.StatusEnum;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.domin.TaskLog;
import com.tykj.dev.device.task.subject.vo.TaskSelectVo;
......@@ -436,7 +436,13 @@ public class TaskServiceImpl implements TaskService {
if (taskSelectVo.getSelectNum() == 2) {
//当前指针对应userId是当前用户或者为0且所属单位为当前单位
List<TaskBto> taskBtoList = taskBtos.stream()
.filter(taskBto -> taskBto.getInvolveUserIdList().size()>0&&(userId.equals(taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint())) || (taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()) == 0 && taskBto.getOwnUnit().equals(userUtils.getCurrentUnitId()))))
.filter(taskBto -> {
boolean involveExists = taskBto.getInvolveUserIdList().size() > 0;
boolean userConfirm = userId.equals(taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()));
boolean noUserHandle = taskBto.getInvolveUserIdList().get(taskBto.getCurrentPoint()) == 0;
boolean belongUnit = taskBto.getOwnUnit().equals(userUtils.getCurrentUnitId());
return involveExists && (userConfirm || (noUserHandle && belongUnit));
})
.collect(Collectors.toList());
//查询所有的业务
if (bussinessType == null) {
......
......@@ -49,6 +49,7 @@ public class TaskBto {
@ApiModelProperty(value = "所属单位")
private Integer ownUnit;
@ApiModelProperty(value = "数字类型,用于代表指针目前的下标")
private Integer currentPoint;
......
......@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
......@@ -20,8 +19,6 @@ import java.util.List;
*/
@Service
public class MyUserDetailsServiceImpl implements UserDetailsService {
@Autowired
private BCryptPasswordEncoder bCryptPasswordEncoder;
@Autowired
private UserService userService;
@Autowired
......
......@@ -39,9 +39,6 @@ import java.io.PrintWriter;
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private MyEntryPoint myEntryPoint;
......
......@@ -15,16 +15,16 @@ import java.util.HashMap;
@NoArgsConstructor
public class ResultObj {
private Object result;
private Object data;
private String msg;
private String message;
public ResultObj(Object o){
this.result = o;
this.msg = "no message";
public ResultObj(Object o) {
this.data = o;
this.message = "no message";
}
public ResultObj(String m){
this.msg = m;
this.result = new HashMap<>(1);
public ResultObj(String m) {
this.message = m;
this.data = new HashMap<>(1);
}
}
......@@ -254,7 +254,17 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>socket</artifactId>
<version>1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>com.tykj.dev</groupId>
<artifactId>union</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--<dependency>-->
<!--<groupId>com.tykj</groupId>-->
<!--<artifactId>dev-socket</artifactId>-->
......@@ -303,6 +313,13 @@
</exclusions>
</dependency>
<!-- Spring Security Test -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
......
......@@ -7,10 +7,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication(scanBasePackages={
"com.tykj.dev.*",
}
)
@SpringBootApplication(scanBasePackages = "com.tykj.dev.*")
@EnableSwagger2
@ServletComponentScan
@EnableJpaAuditing
......
package com.tykj.dev.confirmcheck;
import com.tykj.dev.union.BaseTest;
import org.junit.jupiter.api.Test;
/**
* DeviceCheckControllerTest.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/9/15 at 11:17 上午
*/
class DeviceCheckControllerTest extends BaseTest {
private
@Test
void checkUserA() {
}
@Test
void checkUserB() {
}
@Test
void checkUserC() {
}
}
\ No newline at end of file
package com.tykj.dev.union;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
* BaseTest.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2020/9/15 at 10:57 上午
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = UnionApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class BaseTest {
}
package com.tykj.dev.union;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class UnionApplicationTests {
@Test
void contextLoads() {
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论