更新OA表单校验字段
This commit is contained in:
parent
00e3dc6c05
commit
5dc30f1ac3
|
@ -0,0 +1,12 @@
|
|||
package com.hzya.frame.plugin.oa.poorder.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
|
||||
|
||||
/**
|
||||
* @Description OA采购订单
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/20 17:52
|
||||
**/
|
||||
public interface IPoOrderExtDao extends IBaseDao<PoOrderEntity,String> {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.plugin.oa.poorder.dao.impl;
|
||||
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.plugin.oa.poorder.dao.IPoOrderExtDao;
|
||||
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/20 17:57
|
||||
**/
|
||||
@Repository("poOrderDaoExtImpl")
|
||||
public class PoOrderDaoExtImpl extends MybatisGenericDao<PoOrderEntity,String> implements IPoOrderExtDao {
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.hzya.frame.plugin.oa.poorder.entity;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @Description OA采购订单
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/20 17:47
|
||||
**/
|
||||
public class PoOrderEntity extends BaseEntity {
|
||||
|
||||
private String field0055;//NCC单据号
|
||||
private String field0058;//校验1
|
||||
private String field0059;//校验2
|
||||
|
||||
public String getField0055() {
|
||||
return field0055;
|
||||
}
|
||||
|
||||
public void setField0055(String field0055) {
|
||||
this.field0055 = field0055;
|
||||
}
|
||||
|
||||
public String getField0058() {
|
||||
return field0058;
|
||||
}
|
||||
|
||||
public void setField0058(String field0058) {
|
||||
this.field0058 = field0058;
|
||||
}
|
||||
|
||||
public String getField0059() {
|
||||
return field0059;
|
||||
}
|
||||
|
||||
public void setField0059(String field0059) {
|
||||
this.field0059 = field0059;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.plugin.oa.poorder.dao.impl.PoOrderDaoExtImpl">
|
||||
|
||||
<update id="entity_update" parameterType="com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity">
|
||||
update formmain_0256
|
||||
<set>
|
||||
<if test="field0058 != null and field0058 != '' ">
|
||||
field0058 = #{field0058},
|
||||
</if>
|
||||
<if test="field0059 != null and field0059 != '' ">
|
||||
field0059 = #{field0059}
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.plugin.oa.poorder.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/20 19:36
|
||||
**/
|
||||
public interface IPoOrderExtService extends IBaseService<PoOrderEntity,String> {
|
||||
|
||||
/**
|
||||
* 更新校验字段,防止用户从OA侧发起采购订单
|
||||
* @param entity
|
||||
*/
|
||||
void updateVerifyFlag(PoOrderEntity entity);
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package com.hzya.frame.plugin.oa.poorder.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.hzya.frame.plugin.oa.poorder.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.plugin.oa.poorder.dao.IPoOrderExtDao;
|
||||
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
|
||||
import com.hzya.frame.plugin.oa.poorder.service.IPoOrderExtService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author xiangerlin
|
||||
* @Date 2025/6/20 19:37
|
||||
**/
|
||||
@Service(value = "poOrderExtServiceImpl")
|
||||
public class PoOrderExtServiceImpl extends BaseService<PoOrderEntity,String> implements IPoOrderExtService {
|
||||
|
||||
private IPoOrderExtDao poOrderExtDao;
|
||||
@Autowired
|
||||
|
||||
public void setPoOrderExtDao(IPoOrderExtDao dao) {
|
||||
this.poOrderExtDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新校验字段,防止用户从OA侧发起采购订单
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public void updateVerifyFlag(PoOrderEntity entity) {
|
||||
poOrderExtDao.update(entity);
|
||||
}
|
||||
}
|
|
@ -5,6 +5,10 @@ import cn.hutool.core.util.StrUtil;
|
|||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.execsql.entity.ExecSqlEntity;
|
||||
import com.hzya.frame.execsql.service.IExecSqlService;
|
||||
import com.hzya.frame.plugin.oa.poorder.entity.PoOrderEntity;
|
||||
import com.hzya.frame.plugin.oa.poorder.service.IPoOrderExtService;
|
||||
import com.hzya.frame.plugin.oa.poorder.service.IPoOrderService;
|
||||
import com.hzya.frame.seeyon.enums.ColEventTypeEnum;
|
||||
import com.hzya.frame.seeyon.org.member.entity.UserViewEntity;
|
||||
|
@ -29,9 +33,13 @@ import java.util.List;
|
|||
public class PoOrderServiceImpl implements IPoOrderService {
|
||||
Logger logger = LoggerFactory.getLogger(PoOrderServiceImpl.class);
|
||||
@Autowired
|
||||
private IExecSqlService execSqlService;
|
||||
@Autowired
|
||||
private OARestUtil oaRestUtil;
|
||||
@Autowired
|
||||
private IUserViewService userViewService;
|
||||
@Autowired
|
||||
private IPoOrderExtService poOrderExtService;
|
||||
@Value("${zt.url}")
|
||||
private String interfaceUrl;
|
||||
@Value("${oa.po_order_template_code:}")
|
||||
|
@ -129,7 +137,7 @@ public class PoOrderServiceImpl implements IPoOrderService {
|
|||
|
||||
/**
|
||||
* OA审批事件
|
||||
*
|
||||
*POSTQUANTITY
|
||||
* @param requestJson
|
||||
* @return
|
||||
*/
|
||||
|
@ -151,11 +159,11 @@ public class PoOrderServiceImpl implements IPoOrderService {
|
|||
if (null != formmainData){
|
||||
String pk_order = formmainData.getString("field0056");//采购订单pk
|
||||
String vbillcode = formmainData.getString("field0055");//采购订单code
|
||||
String userId = formmainData.getString("user_id");//审批人id
|
||||
String userId = headers.getString("user_id");//审批人id
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("pk_order",pk_order);
|
||||
json.put("vbillcode",vbillcode);
|
||||
json.put("userId",userId);
|
||||
json.put("user_id",userId);
|
||||
String params = json.toString();
|
||||
//组装参数,调用NCC审批接口
|
||||
logger.info("OA采购订单审批后传到NCC请购参数。:{},{}",eventType,params);
|
||||
|
@ -181,18 +189,23 @@ public class PoOrderServiceImpl implements IPoOrderService {
|
|||
if (!resultJson.getBoolean("flag")){
|
||||
return BaseResult.getFailureMessageEntity("审批NCC采购订单失败"+resultJson.getString("msg"));
|
||||
}
|
||||
//如果是流程终止或撤销,更新OA校验字段
|
||||
if (ColEventTypeEnum.ONSTOP.getType().equals(eventType) || ColEventTypeEnum.ONCANCEL.getType().equals(eventType)){
|
||||
String id = formmainData.getString("id");
|
||||
if (StrUtil.isNotEmpty(id)){
|
||||
logger.info("准备更新OA采购订单校验字段");
|
||||
PoOrderEntity poOrderEntity = new PoOrderEntity();
|
||||
poOrderEntity.setId(id);
|
||||
poOrderEntity.setDataSourceCode("JH-OA");
|
||||
poOrderEntity.setField0058("-1");
|
||||
poOrderEntity.setField0059("-1");
|
||||
poOrderExtService.updateVerifyFlag(poOrderEntity);
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity(resultJson.getJSONObject("attribute"));
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("审批NCC采购订单");
|
||||
}
|
||||
|
||||
private Object convertLowerCase(JSONObject jsonObject, String key){
|
||||
if (null != jsonObject && StrUtil.isNotEmpty(key)){
|
||||
return null == jsonObject.get(key.toUpperCase()) ? jsonObject.get(key.toLowerCase()) : jsonObject.get(key.toUpperCase());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把NCC的 boolean类型转成OA
|
||||
* NCC Y/N
|
||||
|
|
Loading…
Reference in New Issue