Browse Source

2024-10-11

优化
master
fengyuan_yang 1 year ago
parent
commit
f79ea6ed4a
  1. 13
      src/main/java/com/spring/modules/change/controller/ChangeManagementController.java
  2. 3
      src/main/java/com/spring/modules/change/mapper/ChangeManagementMapper.java
  3. 3
      src/main/java/com/spring/modules/change/service/ChangeManagementService.java
  4. 77
      src/main/java/com/spring/modules/change/service/impl/ChangeManagementServiceImpl.java
  5. 14
      src/main/resources/mapper/change/ChangeManagementMapper.xml

13
src/main/java/com/spring/modules/change/controller/ChangeManagementController.java

@ -4,6 +4,7 @@ import com.spring.common.utils.PageUtils;
import com.spring.common.utils.R;
import com.spring.modules.base.data.PlmPropertiesItemData;
import com.spring.modules.base.data.PlmPropertiesModelHeaderData;
import com.spring.modules.base.entity.Bu;
import com.spring.modules.change.entity.*;
import com.spring.modules.change.service.ChangeManagementService;
import com.spring.modules.change.vo.*;
@ -377,4 +378,16 @@ public class ChangeManagementController {
return R.ok().put("rows", list);
}
/**
* 根据site查bu
* @param data
* @return
*/
@PostMapping(value="/getBuBySite")
@ResponseBody
public R getBuBySite(@RequestBody Bu data) {
List<Bu> list = changeManagementService.getBuBySite(data);
return R.ok().put("rows", list);
}
}

3
src/main/java/com/spring/modules/change/mapper/ChangeManagementMapper.java

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spring.modules.base.data.PlmPropertiesItemAvailableData;
import com.spring.modules.base.data.PlmPropertiesItemData;
import com.spring.modules.base.data.PlmPropertiesModelHeaderData;
import com.spring.modules.base.entity.Bu;
import com.spring.modules.change.entity.*;
import com.spring.modules.change.vo.*;
import com.spring.modules.part.entity.AgentInformationEntity;
@ -160,4 +161,6 @@ public interface ChangeManagementMapper extends BaseMapper<ChangeRequestEntity>{
PlmTechnicalSpecificationSheetData getTechnicalSpecification(@Param("site") String site, @Param("codeNo") String codeNo);
void updatePartActive(@Param("site") String site, @Param("partNo") String partNo);
List<Bu> getBuBySite(Bu data);
}

3
src/main/java/com/spring/modules/change/service/ChangeManagementService.java

@ -3,6 +3,7 @@ package com.spring.modules.change.service;
import com.spring.common.utils.PageUtils;
import com.spring.modules.base.data.PlmPropertiesItemData;
import com.spring.modules.base.data.PlmPropertiesModelHeaderData;
import com.spring.modules.base.entity.Bu;
import com.spring.modules.change.entity.*;
import com.spring.modules.change.vo.*;
import com.spring.modules.oss.entity.SysOssEntity;
@ -70,4 +71,6 @@ public interface ChangeManagementService {
Map<String, List<RequestNodeAuthorityEntity>> getNodeAuthority(ChangeRequestVo data);
List<ProcessFormVo> getApprovalList(ProcessFormVo data);
List<Bu> getBuBySite(Bu data);
}

77
src/main/java/com/spring/modules/change/service/impl/ChangeManagementServiceImpl.java

@ -15,6 +15,7 @@ import com.spring.modules.base.data.OaUserData;
import com.spring.modules.base.data.PlmPropertiesItemAvailableData;
import com.spring.modules.base.data.PlmPropertiesItemData;
import com.spring.modules.base.data.PlmPropertiesModelHeaderData;
import com.spring.modules.base.entity.Bu;
import com.spring.modules.base.service.BaseService;
import com.spring.modules.base.service.TransNoControlService;
import com.spring.modules.base.utils.CommonUtils;
@ -1227,24 +1228,55 @@ public class ChangeManagementServiceImpl extends ServiceImpl<ChangeManagementMap
* 回滚方法
*/
public void rollBackFunction(ParamData paramData, Exception e) {
// 撤回接口
DoForceDrawBackParam doForceDrawBackParam = new DoForceDrawBackParam();
doForceDrawBackParam.setUserId(paramData.getUserId());
doForceDrawBackParam.setRequestId(paramData.getRequestId());
String doForceDrawBackURL = apiUrlOa + "/oa/interface/doForceDrawBack";
ResponseData doForceDrawBackResponses = HttpClientUtil.doPostByRawWithOA(doForceDrawBackURL, doForceDrawBackParam);
if (!"0".equals(doForceDrawBackResponses.getCode())) {
throw new RuntimeException(e.getMessage() + "; OA撤回流程异常信息:" + doForceDrawBackResponses.getMsg());
}
// 调用删除流程接口
RequestOperatorInfoParam requestOperatorInfoParam = new RequestOperatorInfoParam();
requestOperatorInfoParam.setUserId(paramData.getUserId());
requestOperatorInfoParam.setRequestId(paramData.getRequestId());
String deleteRequestURL = apiUrlOa + "/oa/interface/deleteRequest";
ResponseData deleteRequestResponses = HttpClientUtil.doPostByRawWithOA(deleteRequestURL, requestOperatorInfoParam);
if (!"0".equals(deleteRequestResponses.getCode())) {
throw new RuntimeException(e.getMessage() + "; OA删除流程异常信息:" + deleteRequestResponses.getMsg());
if (e.getMessage().contains("OA新建流程异常信息")) {
// 撤回接口
DoForceDrawBackParam doForceDrawBackParam = new DoForceDrawBackParam();
doForceDrawBackParam.setUserId(paramData.getUserId());
doForceDrawBackParam.setRequestId(paramData.getRequestId());
String doForceDrawBackURL = apiUrlOa + "/oa/interface/doForceDrawBack";
ResponseData doForceDrawBackResponses = HttpClientUtil.doPostByRawWithOA(doForceDrawBackURL, doForceDrawBackParam);
if (!"0".equals(doForceDrawBackResponses.getCode())) {
throw new RuntimeException(e.getMessage() + "; 强制收回流程异常信息:" + doForceDrawBackResponses.getMsg());
}
// 调用删除流程接口
RequestOperatorInfoParam requestOperatorInfoParam = new RequestOperatorInfoParam();
requestOperatorInfoParam.setUserId(paramData.getUserId());
requestOperatorInfoParam.setRequestId(paramData.getRequestId());
String deleteRequestURL = apiUrlOa + "/oa/interface/deleteRequest";
ResponseData deleteRequestResponses = HttpClientUtil.doPostByRawWithOA(deleteRequestURL, requestOperatorInfoParam);
if (!"0".equals(deleteRequestResponses.getCode())) {
throw new RuntimeException(e.getMessage() + "; OA删除流程异常信息:" + deleteRequestResponses.getMsg());
}
} else {
// 撤回接口
DoForceDrawBackParam doForceDrawBackParam = new DoForceDrawBackParam();
doForceDrawBackParam.setUserId(paramData.getUserId());
doForceDrawBackParam.setRequestId(paramData.getRequestId());
String doForceDrawBackURL = apiUrlOa + "/oa/interface/doForceDrawBack";
ResponseData doForceDrawBackResponses = HttpClientUtil.doPostByRawWithOA(doForceDrawBackURL, doForceDrawBackParam);
if (!"0".equals(doForceDrawBackResponses.getCode())) {
throw new RuntimeException(e.getMessage() + "; 强制收回流程异常信息:" + doForceDrawBackResponses.getMsg());
}
}
// // 撤回接口
// DoForceDrawBackParam doForceDrawBackParam = new DoForceDrawBackParam();
// doForceDrawBackParam.setUserId(paramData.getUserId());
// doForceDrawBackParam.setRequestId(paramData.getRequestId());
// String doForceDrawBackURL = apiUrlOa + "/oa/interface/doForceDrawBack";
// ResponseData doForceDrawBackResponses = HttpClientUtil.doPostByRawWithOA(doForceDrawBackURL, doForceDrawBackParam);
// if (!"0".equals(doForceDrawBackResponses.getCode())) {
// throw new RuntimeException(e.getMessage() + "; OA撤回流程异常信息:" + doForceDrawBackResponses.getMsg());
// }
// // 调用删除流程接口
// RequestOperatorInfoParam requestOperatorInfoParam = new RequestOperatorInfoParam();
// requestOperatorInfoParam.setUserId(paramData.getUserId());
// requestOperatorInfoParam.setRequestId(paramData.getRequestId());
// String deleteRequestURL = apiUrlOa + "/oa/interface/deleteRequest";
// ResponseData deleteRequestResponses = HttpClientUtil.doPostByRawWithOA(deleteRequestURL, requestOperatorInfoParam);
// if (!"0".equals(deleteRequestResponses.getCode())) {
// throw new RuntimeException(e.getMessage() + "; OA删除流程异常信息:" + deleteRequestResponses.getMsg());
// }
throw new RuntimeException(e.getMessage());
}
@ -1812,6 +1844,17 @@ public class ChangeManagementServiceImpl extends ServiceImpl<ChangeManagementMap
return list;
}
/**
*
* @param data
* @return
*/
@Override
public List<Bu> getBuBySite(Bu data) {
List<Bu> buList = changeManagementMapper.getBuBySite(data);
return buList;
}
/**
* 变更申请新增校验参数

14
src/main/resources/mapper/change/ChangeManagementMapper.xml

@ -24,6 +24,9 @@
LEFT JOIN plm_customer_information j ON j.site = c.site and j.customer_no = c.customer_id
<where>
a.site = #{query.site} AND (a.ECN_flag is null or a.ECN_flag = 'N')
<if test = "query.buNo != null and query.buNo != ''">
AND b.bu_no = #{query.buNo}
</if>
<if test = "query.partNo != null and query.partNo != ''">
AND a.test_part_no like #{query.partNo}
</if>
@ -1034,4 +1037,15 @@
set active = 'N'
where site = #{site} and part_no = #{partNo}
</update>
<select id="getBuBySite" parameterType="Bu" resultType="Bu">
SELECT
id,
site,
bu_no,
bu_desc,
remark
FROM BU
where site = #{site} and active = 'Y'
</select>
</mapper>
Loading…
Cancel
Save