提交 18c4d60d authored 作者: 133's avatar 133

[用户] [清退] [专管员统计] 代码提交

上级 690435a5
......@@ -63,6 +63,29 @@ public class BlockchaController {
return ResponseEntity.ok(blockChainUtil.sendHash(code,"8a4df5a249be4b3890eeea22bd238feb"));
}
@ApiOperation(value = "文本添加")
@GetMapping(value = "/sendHash1/{code}/{content}")
public ResponseEntity sendHash1(@PathVariable Integer code,@PathVariable String content){
// content= HexUtil.string2HexUTF8(content);
return ResponseEntity.ok(blockChainUtil.sendText(code,content));
}
@ApiOperation(value = "文本最佳添加")
@GetMapping(value = "/sendHash2/{id}/{content}")
public ResponseEntity sendHash2(@PathVariable String id,@PathVariable String content){
// content= HexUtil.string2HexUTF8(content);
return ResponseEntity.ok(blockChainUtil.appendText(content,id));
}
@ApiOperation(value = "文本篡改验证")
@GetMapping(value = "/sendHash3/{id}/{content}")
public ResponseEntity sendHash3(@PathVariable String id,@PathVariable String content){
// content= HexUtil.string2HexUTF8(content);
return ResponseEntity.ok(blockChainUtil.verifyText(content,id));
}
@GetMapping(value = "/fetchRecord/{id}")
@ApiOperation(value = "查询接口")
public ResponseEntity fetchRecord(@PathVariable String id){
......
......@@ -19,7 +19,6 @@ class ApiSignatureUtil {
* @param key SECRET_KEY
*/
static String getApiSignature(SortedMap<Object, Object> map, String key) {
StringBuilder sb = new StringBuilder();
map.forEach((k, v) -> sb.append(k).append("=").append(v).append("&"));
String str = sb.toString();
......
......@@ -27,9 +27,9 @@ import java.util.UUID;
@Component
public class BlockChainUtilImpl implements BlockChainUtil {
private final static String SECRET_KEY = "aLTEmMyIfAWzVCIy8EKI0uGFThrR20dR12C62ENZ16RAX5TNTLUC4CCP";
private final static String SECRET_ID = "tLNj025SOWTWv56ORlRdGA";
private final static String BLOCK_CHAIN_URL = "http://192.168.3.2";
private final static String SECRET_KEY = "3RJWStDCXN7mqJyZAB8rF59f87arGShdk9aKyDN3wKbzq9JnaXom1Hpe6mHT1k2yx9zfE7VFWidqwuxyT7DtPjCs";
private final static String SECRET_ID = "JAjQyTZdR8bmbHaU6iiFGvrCuUik4cG4U4ostk8KKrbS";
private final static String BLOCK_CHAIN_URL = "http://192.168.0.80:8076";
@Override
......@@ -84,6 +84,7 @@ public class BlockChainUtilImpl implements BlockChainUtil {
request.put("content", HexUtil.hex64(content));
request.put("subCode", subCode);
String s = ApiSignatureUtil.getApiSignature(request, SECRET_KEY);
log.info("apiSignature:{}",s);
request.put("apiSignature", s);
return new RestTemplate().postForObject(
BLOCK_CHAIN_URL + BcUrl.SEND_HASH,
......
......@@ -153,11 +153,9 @@ public enum LogType {
TRAIN8(68, TRAIN1007.id, END.id, "省培训完成"),
SEND_BACK_1(69, ORIGIN_STATUS.id, SEND_BACK_1200.id, "清退任务创建完成,等待下属单位把装备退回"),
SEND_BACK_2(70, ORIGIN_STATUS.id, SEND_BACK_1203.id, "装备出库校验完成,等待出库"),
SEND_BACK_3(71, SEND_BACK_1203.id, SEND_BACK_1202.id, "装备出库完成,等待审核"),
SEND_BACK_4(72, SEND_BACK_1202.id, SEND_BACK_1206.id, "清退装备出库审核通过,等待签收"),
SEND_BACK_5(73, SEND_BACK_1206.id, SEND_BACK_1204.id, "签收成功等待入库审核"),
SEND_BACK_6(74, SEND_BACK_1204.id, END.id, "入库审核通过"),
SEND_BACK_2(70, ORIGIN_STATUS.id, SEND_BACK_1203.id, "等待装备清退出库"),
SEND_BACK_3(71, SEND_BACK_1203.id, SEND_BACK_1206.id, "(%sendUnit)装备清退出库完成,向(%receiveUnit)发起清退装备,等待签收"),
SEND_BACK_4(72, SEND_BACK_1206.id, END.id, "(%receiveUnit)签收(%sendUnit)单位清退的装备,装备入库成功"),
SEND_BACK_7(75, ORIGIN_STATUS.id, SEND_BACK_1205.id, "异常装备任务生成,等待填写装备异常信息"),
SEND_BACK_8(76, SEND_BACK_1205.id, END.id, "异常装备处理完成"),
SEND_BACK_9(77, ORIGIN_STATUS.id, SEND_BACK_1207.id, "异常装备的确认任务"),
......
......@@ -13,4 +13,7 @@ public class Param {
*/
private String receiveUnit;
private String sendUnit;
}
......@@ -17,6 +17,7 @@ import com.tykj.dev.misc.base.BusinessEnum;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.StringSplitUtil;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......@@ -40,6 +41,7 @@ import java.util.Optional;
* @createTime 2020年08月13日 15:25:00
*/
@Service
@Slf4j
public class TrainThemeServiceImpl implements TrainThemeService {
@Autowired
......@@ -152,16 +154,18 @@ public class TrainThemeServiceImpl implements TrainThemeService {
@Override
public TrainThemePage findTrainPageVo(ConditionsTrainVo conditionsTrainVo) {
Pageable pageable = PageRequest.of(conditionsTrainVo.getPage(), conditionsTrainVo.getSize(), Sort.Direction.ASC, "trainTime");
Page<TrainTheme> all = getContacts(conditionsTrainVo, pageable);
Page<TrainTheme> all = getContacts(conditionsTrainVo,pageable);
List<TrainThemeVo> list = new ArrayList<>();
all.get().forEach(
all.getContent().forEach(
trainTheme -> {
if (trainTheme!=null) {
log.info("train id{}",trainTheme.getTrainId());
TaskBto taskBto = trainTaskService.selectFatherIsNullAndBillidAndBillType(trainTheme.getTrainId(), BusinessEnum.TRAIN.id);
TrainThemeVo trainThemeVo=trainTheme.toTrainThemeVo();
TrainThemeVo trainThemeVo = trainTheme.toTrainThemeVo();
trainThemeVo.setTaskId(taskBto.getId());
list.add(trainThemeVo);
}
}
);
......
......@@ -32,7 +32,7 @@
<profile>
<id>local</id>
<properties>
<pom.package>jar</pom.package>
<pom.package>war</pom.package>
<activatedProperties>local</activatedProperties>
</properties>
</profile>
......
......@@ -392,11 +392,11 @@ public class LogAspect {
if (sendBackBillDao != null && sendBackBillDetailDao != null) {
SendBackBill sendBackBill = sendBackBillDao.getOne(outPutTask.getBillId());
SendBackBillDetail sendBackBillDetail = sendBackBillDetailDao.findSendBackBillDetailById(sendBackBill.getFormId());
getFieldsParam(sendBackBill);
if ((this.oldStatus.equals(StatusEnum.SEND_BACK_1203.id) && this.newStatus.equals(StatusEnum.SEND_BACK_1202.id))) {
getFieldsParam(sendBackBillDetail);
if ((this.oldStatus.equals(StatusEnum.SEND_BACK_1203.id) && this.newStatus.equals(StatusEnum.SEND_BACK_1206.id))) {
this.fileVos.add(new FileVo("出库确认单", sendBackBillDetail.getFileName(), sendBackBillDetail.getFileUrl()));
}
if ((this.oldStatus.equals(StatusEnum.SEND_BACK_1206.id) && this.newStatus.equals(StatusEnum.SEND_BACK_1204.id))) {
if ((this.oldStatus.equals(StatusEnum.SEND_BACK_1206.id) && this.newStatus.equals(StatusEnum.END.id))) {
this.fileVos.add(new FileVo("清退单", sendBackBillDetail.getBillFileName(), sendBackBillDetail.getBillFileUrl()));
}
}
......
......@@ -9,9 +9,11 @@ import com.tykj.dev.device.user.subject.service.AreaService;
import com.tykj.dev.device.user.subject.service.UnitsService;
import com.tykj.dev.device.user.subject.service.UserLogService;
import com.tykj.dev.device.user.subject.service.UserService;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
......@@ -53,6 +55,7 @@ public class UserServiceImpl implements UserService {
public User save(User user, SecurityUser securityUser) {
String encode = bCryptPasswordEncoder.encode("qwer1234");
user.setPassword(encode);
user.setNoPassword("qwer1234");
Units units = unitsService.findById(user.getUnitsId());
User user1 = userDao.save(user);
switch (units.getLevel()){
......@@ -118,6 +121,13 @@ public class UserServiceImpl implements UserService {
@Override
public User update(User user) {
Optional<User> userOptional = userDao.findById(user.getUserId());
if (userOptional.isPresent()){
User user1= userOptional.get();
user.setNoPassword(user1.getNoPassword());
}else {
throw new ApiException(ResponseEntity.status(500).body("没找到对应的用户id"));
}
return userDao.save(user);
}
......
......@@ -39,7 +39,7 @@ public class VenitalisServiceImpl implements VenitalisService {
private UserLogDao userLogDao;
private final static String http="http://192.168.0.80:8081";
private final static String http="http://10.153.4.11:8081";
private final static String REGISTERE="/api/v2/auth/register";
private final static String CONTRAST="/api/v2/auth/identify";
@Override
......
......@@ -43,7 +43,6 @@
<module>dev-user</module>
<module>dev-usereport</module>
<module>dev-statistical</module>
<module>dev-read</module>
</modules>
<properties>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论