Commit 537013b1 by 李小惠

修改orderMain数据结构

parent e8f1eb20
This source diff could not be displayed because it is too large. You can view the blob instead.
2024-01-27 10:39:29.104 ERROR 24616 --- [http-nio-10030-exec-9] c.j.j.b.c.handle.GlobalExceptionHandler : >授权异常>>获取token失败,请检查header和param中是否传递了用户token
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -78,7 +78,5 @@ public class OrderDetailDto implements Serializable {
//Epc类型(0固定资产1库存物资非固定资产)
private Integer property;
//计划子单json
private String eqsJson;
}
......@@ -129,5 +129,7 @@ public class OrderDto implements Serializable {
private String removeLocationName;
private String note;
//计划子单json
private String eqsJson;
}
......@@ -113,5 +113,8 @@ public class OrderMainDto implements Serializable {
*/
private String removeLocationName;
//计划子单json
private String eqsJson;
}
......@@ -85,6 +85,5 @@ public class OrderDetailReq extends BaseRequest {
//Epc类型(0固定资产1库存物资非固定资产)
private Integer property;
//计划子单json
private String eqsJson;
}
......@@ -127,6 +127,8 @@ public class OrderMainReq extends BaseRequest {
private String receiveUserId;
//发物单位,有可能是组织机构也有可能是供应商
private String name;
//计划子单json
private String eqsJson;
}
......
......@@ -38,7 +38,7 @@ public class UpdateEquipmentTypeReq {
private String photo;
private List<String> supplierList;
@NotNull(message = "时间戳不能为空",groups = {ValidationApi.export.class})
private Long updateTime;
private BigDecimal price;
......
......@@ -93,6 +93,5 @@ public class UpdateOrderDetailReq implements Serializable {
//Epc类型(0固定资产1库存物资非固定资产)
private Integer property;
//计划子单json
private String eqsJson;
}
......@@ -178,5 +178,7 @@ public class UpdateOrderReq extends BaseRequest implements Serializable {
private Long logSummaryId;
private Date createTime;
//计划子单json
private String eqsJson;
}
......@@ -52,7 +52,7 @@ public class EquipmentTypeController {
return ApiRes.success(equipmentTypeService.changeEquipmentState(req));
}
@PostMapping(path="/ShowEquipmentList",name="查询类别列表#enable")
@PostMapping(path="/",name="查询类别列表#enable")
@ApiOperation("查询类别列表")
public ApiRes<List<EquipmentTypeDto>> ShowEquipmentList(@RequestBody QueryEquipmentTypeReq req) {
return ApiRes.success(equipmentTypeService.getEquipmentList(req));
......@@ -106,7 +106,7 @@ public class EquipmentTypeController {
@PostMapping(path="/alignTypeInfo",name="同步更新类型信息#enable")
@ApiOperation("同步更新类型信息")
public ApiRes<List<TypeDto>> alignTypeInfo(@RequestBody UpdateEquipmentTypeReq req){
public ApiRes<List<TypeDto>> alignTypeInfo(@RequestBody @Validated(ValidationApi.export.class) UpdateEquipmentTypeReq req){
return ApiRes.success(equipmentTypeService.alignTypeInfo(req));
}
......
......@@ -13,10 +13,7 @@ import com.junmp.jyzb.api.bean.req.CabinetPolicemanReq;
import com.junmp.jyzb.api.bean.req.CabinetUploadReq;
import com.junmp.jyzb.api.bean.req.UpdatePolicemanReq;
import com.junmp.jyzb.api.bean.req.UpdateReassignmentReq;
import com.junmp.jyzb.entity.EquipmentSize;
import com.junmp.jyzb.entity.PoliceEquipment;
import com.junmp.jyzb.entity.Policeman;
import com.junmp.jyzb.entity.Reassignment;
import com.junmp.jyzb.entity.*;
import com.junmp.jyzb.service.PolicemanService;
import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.v2.common.bean.request.ValidationApi;
......@@ -315,4 +312,9 @@ public class PoliceController {
return ApiRes.success(policemanService.alignUserInfo(req));
}
@PostMapping(path = "/oneClickAccountCreation",name = "一键生成账号(运维,管理,审核)#logType=30")
public ApiRes<Boolean> oneClickAccountCreation(@RequestBody PubOrg pubOrg){
return ApiRes.success(policemanService.oneClickAccountCreation(pubOrg));
}
}
......@@ -116,8 +116,4 @@ import java.util.Date;
@TableField(value = "property")
private Integer property;
@TableField(value = "eqs_json")
private String eqsJson;
}
......@@ -164,5 +164,8 @@ public class OrderMain implements Serializable {
@TableField("detail_json")
private String detailJson;
@TableField("eqs_json")
private String eqsJson;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -62,4 +62,6 @@ public interface PolicemanMapper extends BaseMapper<Policeman> {
@Param("roleCodeList") List<String> roleCodeList);
List<UserDto> alignUserInfo(@Param("orgId") Long orgId, @Param("date")String date);
List<UserDto> oneClickAccountCreation(@Param("orgId") Long orgId);
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import com.junmp.jyzb.api.bean.query.QueryReassignmentReq;
import com.junmp.jyzb.api.bean.req.*;
import com.junmp.jyzb.entity.PoliceEquipment;
import com.junmp.jyzb.entity.Policeman;
import com.junmp.jyzb.entity.PubOrg;
import com.junmp.jyzb.entity.Reassignment;
import com.junmp.v2.common.bean.response.ApiRes;
import com.junmp.v2.db.api.page.PageResult;
......@@ -121,4 +122,6 @@ public interface PolicemanService extends IService<Policeman> {
List<PoliceDto> alignPoliceInfo(PolicemanReq req);
List<UserDto> alignUserInfo(PolicemanReq req);
boolean oneClickAccountCreation(PubOrg pubOrg);
}
......@@ -539,24 +539,6 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
sizeAndType.setSizeList(CollectionUtil.isNotEmpty(collect1)?collect1:new ArrayList<>());
String jsonString = JSONObject.toJSONString(sizeAndType);
// try {
// byte[] byKey = Arrays.copyOf("junmp888".getBytes(StandardCharsets.UTF_8), 8);
// byte[] iv = { (byte)0x12, (byte)0x34, (byte)0x56, (byte)0x78, (byte)0x90, (byte)0xAB, (byte)0xCD, (byte)0xEF };
//
// SecretKeySpec secretKeySpec = new SecretKeySpec(byKey, "DES");
// IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);
//
// Cipher desCipher = Cipher.getInstance("DES/CBC/NoPadding");
// desCipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
//
// byte[] inputByteArray = jsonString.getBytes(StandardCharsets.UTF_8);
// byte[] encryptedBytes = desCipher.doFinal(inputByteArray);
//
// return Base64.getEncoder().encodeToString(encryptedBytes);
// } catch (Exception e) {
// e.printStackTrace();
// return "";
// }
try {
// 设置密钥和初始化向量
byte[] byKey = Arrays.copyOf("junmp888".getBytes(StandardCharsets.UTF_8), 8);
......
......@@ -58,6 +58,7 @@ import com.junmp.v2.sys.user.factory.SysUserCreateFactory;
import com.junmp.v2.sys.user.service.SysUserOrgService;
import com.junmp.v2.sys.user.service.SysUserRoleService;
import com.junmp.v2.sys.user.service.SysUserService;
import com.sun.org.apache.bcel.internal.generic.SWITCH;
import liquibase.pro.packaged.O;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -2054,4 +2055,55 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
return policemanMapper.alignUserInfo(orgId,date);
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean oneClickAccountCreation(PubOrg pubOrg) {
//一次性创建一个组织机构下的三种系统账号(运维,仓管员,审核员)
//先判断一下前端是否传递组织机构编号(如果传递,指定创建该组织机构下的三种账号)
List<String> userAccountList=new ArrayList<>();
userAccountList.add("yw");
userAccountList.add("sh");
userAccountList.add("gl");
if (ObjectUtil.isNull(pubOrg.getOrgCode()) || pubOrg.getOrgCode().trim().isEmpty()){
//如果没有组织机构编号,需要判断全部组织机构下面是否已经存在对应的账号,如果存在则不创建账号,否则创建指定账号
List<UserDto> userDtos = policemanMapper.oneClickAccountCreation(null);
}else {
//如果有组织机构编号,则判断该组织机构下面是否已经存在账号,如果存在,则不进行创建,否则进行创建
PubOrg one = pubOrgService.getOne(new LambdaQueryWrapper<PubOrg>()
.eq(PubOrg::getOrgCode, pubOrg.getOrgCode()));
if (ObjectUtil.isNull(one)){
throw new ServiceException(OrgExceptionEnum.ORG_NOT_EXIST);
}
List<UserDto> userDtos = policemanMapper.oneClickAccountCreation(one.getOrgId());
if (CollectionUtil.isEmpty(userDtos)){
for (int i = 0; i < userAccountList.size(); i++) {
SysUser sysUser= new SysUser();
sysUser.setNickName(userAccountList.get(i)+one.getOrgCode());
sysUser.setRealName(userAccountList.get(i)+one.getOrgCode());
sysUser.setAccount(userAccountList.get(i)+one.getOrgCode());
SysUserCreateFactory.fillAddSysUser(sysUser);
sysUser.setAvatar(FileConstant.DEFAULT_AVATAR_FILE_ID);
sysUser.setDelFlag(LogicDelEnum.N.getCode());
sysUser.setCreateTime(DateTime.now());
sysUser.setUpdateTime(DateTime.now());
sysUserService.save(sysUser);
sysUserOrgService.add(sysUser.getUserId(), one.getOrgId(), null);
}
}else {
for (UserDto user:userDtos) {
boolean flag=false;
if (user.getAccount().equals("yw"+one.getOrgCode()) || user.getAccount().equals("sh"+one.getOrgCode())||user.getAccount().equals("gl"+one.getOrgCode())){
flag=true;
}
}
}
}
return false;
}
}
package com.junmp.jyzb.task;
import com.junmp.jyzb.config.rabbitMQ.TopicRabbitConfig;
import com.junmp.v2.job.api.JobAction;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class QueueBindExchangeAction implements JobAction {
@Autowired
TopicRabbitConfig topicRabbitConfig;
@Override
public void action() {
topicRabbitConfig.createQueuesAndBindings(topicRabbitConfig.topicExchange());
}
}
......@@ -358,6 +358,17 @@ WHERE o.org_id IN
where su.update_time &gt; #{date}
</if>
</select>
<select id="oneClickAccountCreation" resultType="com.junmp.jyzb.api.bean.dto.FetchingDataDto.UserDto">
select t.*,uo.org_id FROM (
SELECT u.* FROM `sys_user_copy1` u where u.account like "gl33%" or u.account like "yw33%" or u.account like "sh33%") as t
join sys_user_org_copy1 uo on t.user_id=uo.user_id
<if test="orgId != null and orgId != ''">
and uo.org_id=#{orgId}
</if>
join sys_user_role_copy1 ur on t.user_id=ur.user_id
join sys_role r on ur.role_id=r.role_id and r.role_id in ("1528003832557232130","1663372320355389441","1663372027127402498")
order by uo.org_id
</select>
</mapper>
\ No newline at end of file
......@@ -55,7 +55,7 @@ public class SysFormController {
return ApiRes.success(SysFormService.CheckConfig(br));
}
@ApiOperation("检查配置是否可用")
@PostMapping(value = "CheckConfig")
@PostMapping(value = "DeleteFormList")
public ApiRes<Boolean> DeleteFormList(@RequestBody String br) {
return ApiRes.success(SysFormService.DeleteFrom(br));
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论