parent
c504012232
commit
f450395718
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.plugin.kjs.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapBuilder;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
|
@ -18,6 +19,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
@ -29,7 +31,7 @@ import java.util.Map;
|
|||
* @Author xiangerlin
|
||||
* @Date 2024/8/22 16:46
|
||||
**/
|
||||
public class DeliveryOrderPluginServiceImpl implements IDeliveryOrderPluginService {
|
||||
public class DeliveryOrderPluginServiceImpl extends KjsPluginBaseService implements IDeliveryOrderPluginService {
|
||||
Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Autowired
|
||||
private IDeliveryOrderService deliveryOrderService;
|
||||
|
@ -37,6 +39,7 @@ public class DeliveryOrderPluginServiceImpl implements IDeliveryOrderPluginServi
|
|||
private IDeliveryDetaiService deliveryDetaiService;
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
|
||||
|
||||
/**
|
||||
* 发货单同步到wsm
|
||||
* @param requestJson
|
||||
|
@ -45,16 +48,26 @@ public class DeliveryOrderPluginServiceImpl implements IDeliveryOrderPluginServi
|
|||
@Override
|
||||
public String sync2wms(JSONObject requestJson) {
|
||||
if (null != requestJson){
|
||||
requestJson = super.check(requestJson);
|
||||
//数据源编码
|
||||
String datasourceCode = requestJson.getString("sourceCode");
|
||||
//开始时间
|
||||
String startTime = requestJson.getString("startTime");
|
||||
//结束时间
|
||||
String endTime = requestJson.getString("endTime");
|
||||
//1 查询发货单主表
|
||||
DeliveryOrderEntity orderEntity = new DeliveryOrderEntity();
|
||||
orderEntity.setDataSourceCode(datasourceCode);
|
||||
String id = requestJson.getString("integration_task_living_details_id");
|
||||
if (StrUtil.isNotEmpty(id)){
|
||||
if (StrUtil.isEmpty(id)){
|
||||
orderEntity.setStartTime(startTime);
|
||||
orderEntity.setEndTime(endTime);
|
||||
//orderEntity.setDlid("1000000152");
|
||||
orderEntity.setbReturnFlag("0");
|
||||
}else {
|
||||
IntegrationTaskLivingDetailsEntity taskLivingDetails = taskLivingDetailsService.get(id);
|
||||
orderEntity.setDlid(taskLivingDetails.getRootAppPk());
|
||||
}
|
||||
orderEntity.setDataSourceCode("YONYOUU8");
|
||||
orderEntity.setDlid("1000000152");
|
||||
orderEntity.setbReturnFlag("0");
|
||||
List<DeliveryOrderEntity> orderList = deliveryOrderService.query(orderEntity);
|
||||
if (CollectionUtils.isNotEmpty(orderList)){
|
||||
for (DeliveryOrderEntity order : orderList) {
|
||||
|
@ -62,7 +75,7 @@ public class DeliveryOrderPluginServiceImpl implements IDeliveryOrderPluginServi
|
|||
//2 查询发货单明细表
|
||||
DeliveryDetailEntity detailEntity = new DeliveryDetailEntity();
|
||||
detailEntity.setDlid(order.getDlid());
|
||||
detailEntity.setDataSourceCode("YONYOUU8");
|
||||
detailEntity.setDataSourceCode(datasourceCode);
|
||||
List<DeliveryDetailEntity> detailList = deliveryDetaiService.query(detailEntity);
|
||||
//发货单表头entity转dto
|
||||
DeliveryOrderDTO deliveryOrderDTO = DeliveryMapper.INSTANCE.deliveryEntityToDto(order);
|
||||
|
@ -73,28 +86,29 @@ public class DeliveryOrderPluginServiceImpl implements IDeliveryOrderPluginServi
|
|||
logger.info("发货单请求参数:{}",reqParams);
|
||||
//调用wms接口
|
||||
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
|
||||
.put("apiCode", "")
|
||||
.put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")
|
||||
.put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
|
||||
.put("appId","")
|
||||
.put("apiCode", "8000080006")
|
||||
.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")
|
||||
.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
|
||||
.put("appId","800008")
|
||||
.build();
|
||||
//String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(reqParams).timeout(60000).execute().body();
|
||||
//保存日志
|
||||
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
|
||||
taskLivingDetail.setCreate_time(new Date());
|
||||
taskLivingDetail.setModify_time(new Date());
|
||||
taskLivingDetail.setRootAppPk(order.getDlid());
|
||||
taskLivingDetail.setRootAppBill(order.getCdlcode());
|
||||
taskLivingDetail.setPluginId("kjsDeliveryOrderPlugin");
|
||||
taskLivingDetail.setRootAppNewData(reqParams);
|
||||
//判断,成功调用这个方法
|
||||
//taskLivingDetailsService.saveLogToSuccess(taskLivingDetail);
|
||||
//失败 调用这个方法
|
||||
//taskLivingDetailsService.saveLogToFail(taskLivingDetail);
|
||||
//如果是重试 成功调这个方法
|
||||
//taskLivingDetailsService.saveLogFailToSuccess(taskLivingDetail);
|
||||
//如果是重试 失败调这个方法
|
||||
// taskLivingDetailsService.updateLogFailToSuccess(taskLivingDetail);
|
||||
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(reqParams).timeout(60000).execute().body();
|
||||
//保存自定义项 标记推送状态
|
||||
order.setDataSourceCode(datasourceCode);
|
||||
//deliveryOrderService.saveExtradefine(order);
|
||||
if (StrUtil.isNotEmpty(body)){
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
Boolean flag = jsonObject.getBoolean("flag");
|
||||
//保存日志
|
||||
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
|
||||
taskLivingDetail.setCreate_time(new Date());
|
||||
taskLivingDetail.setModify_time(new Date());
|
||||
taskLivingDetail.setRootAppPk(order.getDlid());
|
||||
taskLivingDetail.setRootAppBill(order.getCdlcode());
|
||||
taskLivingDetail.setPluginId("kjsDeliveryOrderPlugin");
|
||||
taskLivingDetail.setRootAppNewData(reqParams);
|
||||
taskLivingDetail.setNewTransmitInfo(body);
|
||||
this.saveLog(id,flag,taskLivingDetail);
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("同步发货单到wsm出错:{}",e);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package com.hzya.frame.plugin.kjs.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description 共用接口
|
||||
* @Author xiangerlin
|
||||
* @Date 2024/8/23 18:45
|
||||
**/
|
||||
public class KjsPluginBaseService {
|
||||
Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Resource
|
||||
private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
|
||||
/**
|
||||
* 检查请求参数
|
||||
* @param requestJson
|
||||
* @return
|
||||
*/
|
||||
public JSONObject check(JSONObject requestJson) {
|
||||
if (null == requestJson){
|
||||
requestJson = new JSONObject();
|
||||
}
|
||||
if (StrUtil.isEmpty(requestJson.getString("sourceCode"))){
|
||||
requestJson.put("sourceCode","YONYOUU8");
|
||||
}
|
||||
if (StrUtil.isEmpty(requestJson.getString("startTime"))){
|
||||
requestJson.put("startTime", DateUtil.now());
|
||||
}
|
||||
if (StrUtil.isEmpty(requestJson.getString("endTime"))){
|
||||
requestJson.put("endTime", DateUtil.now());
|
||||
}
|
||||
return requestJson;
|
||||
}
|
||||
|
||||
public void saveLog(String integration_task_living_details_id, Boolean flag, IntegrationTaskLivingDetailsEntity taskLivingDetail){
|
||||
try {
|
||||
//判断,成功调用这个方法
|
||||
if (StrUtil.isEmpty(integration_task_living_details_id)){
|
||||
if (flag){
|
||||
taskLivingDetailsService.saveLogToSuccess(taskLivingDetail);
|
||||
}else {
|
||||
//失败 调用这个方法
|
||||
taskLivingDetailsService.saveLogToFail(taskLivingDetail);
|
||||
}
|
||||
}else {
|
||||
if (flag){
|
||||
//如果是重试 成功调这个方法
|
||||
taskLivingDetailsService.saveLogFailToSuccess(taskLivingDetail);
|
||||
}else {
|
||||
//如果是重试 失败调这个方法
|
||||
taskLivingDetailsService.updateLogFailToSuccess(taskLivingDetail);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("保存日志出错:{}",e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.plugin.kjs.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapBuilder;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
|
@ -18,6 +19,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
@ -29,7 +31,7 @@ import java.util.Map;
|
|||
* @Author xiangerlin
|
||||
* @Date 2024/8/23 09:21
|
||||
**/
|
||||
public class MomOrderPluginServiceImpl implements IMomOrderPluginService {
|
||||
public class MomOrderPluginServiceImpl extends KjsPluginBaseService implements IMomOrderPluginService {
|
||||
Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Autowired
|
||||
private IMomOrderService momOrderService;
|
||||
|
@ -46,16 +48,26 @@ public class MomOrderPluginServiceImpl implements IMomOrderPluginService {
|
|||
@Override
|
||||
public String sync2wms(JSONObject requestJson) {
|
||||
if (null != requestJson){
|
||||
//1查询主表
|
||||
requestJson = super.check(requestJson);
|
||||
//数据源编码
|
||||
String datasourceCode = requestJson.getString("sourceCode");
|
||||
//开始时间
|
||||
String startTime = requestJson.getString("startTime");
|
||||
//结束时间
|
||||
String endTime = requestJson.getString("endTime");
|
||||
|
||||
MomOrderEntity entity = new MomOrderEntity();
|
||||
entity.setDataSourceCode(datasourceCode);
|
||||
String id = requestJson.getString("integration_task_living_details_id");
|
||||
//如果这个id不为空说明是重试
|
||||
if (StrUtil.isNotEmpty(id)){
|
||||
if (StrUtil.isEmpty(id)){
|
||||
entity.setStartTime(startTime);
|
||||
entity.setEndTime(endTime);
|
||||
}else {
|
||||
IntegrationTaskLivingDetailsEntity taskLivingDetails = taskLivingDetailsService.get(id);
|
||||
entity.setMoId(taskLivingDetails.getRootAppPk());
|
||||
}
|
||||
entity.setMoId("1000000001");
|
||||
entity.setDataSourceCode("YONYOUU8");
|
||||
//1查询主表
|
||||
List<MomOrderEntity> orderList = momOrderService.query(entity);
|
||||
if (CollectionUtils.isNotEmpty(orderList)){
|
||||
for (MomOrderEntity order : orderList) {
|
||||
|
@ -63,7 +75,7 @@ public class MomOrderPluginServiceImpl implements IMomOrderPluginService {
|
|||
//查询生产订单明细表
|
||||
MomOrderDetailEntity detailEntity = new MomOrderDetailEntity();
|
||||
detailEntity.setMoId(order.getMoId());
|
||||
detailEntity.setDataSourceCode("YONYOUU8");
|
||||
detailEntity.setDataSourceCode(datasourceCode);
|
||||
List<MomOrderDetailEntity> detailList = momOrderDetailService.query(detailEntity);
|
||||
//表头转换dto
|
||||
MomOrderDTO momOrderDTO = MomOrderMapper.INSTANCE.momOrderEntityToDto(order);
|
||||
|
@ -73,29 +85,29 @@ public class MomOrderPluginServiceImpl implements IMomOrderPluginService {
|
|||
String reqParam = JSONObject.toJSONString(momOrderDTO);
|
||||
logger.info("u8生产订单传wms请求参数:{}",reqParam);
|
||||
Map<String, String> headerMap = MapBuilder.<String, String>create(true)
|
||||
.put("apiCode", "")
|
||||
.put("apiCode", "8000080006")
|
||||
.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")
|
||||
.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
|
||||
.put("appId","")
|
||||
.put("appId","800008")
|
||||
.build();
|
||||
//String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(reqParam).timeout(60000).execute().body();
|
||||
|
||||
//保存日志
|
||||
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
|
||||
taskLivingDetail.setCreate_time(new Date());
|
||||
taskLivingDetail.setModify_time(new Date());
|
||||
taskLivingDetail.setRootAppPk(order.getMoId());
|
||||
taskLivingDetail.setRootAppBill(order.getMocode());
|
||||
taskLivingDetail.setPluginId("kjsMomOrderPlugin");
|
||||
taskLivingDetail.setRootAppNewData(reqParam);
|
||||
//判断,成功调用这个方法
|
||||
//taskLivingDetailsService.saveLogToSuccess(taskLivingDetail);
|
||||
//失败 调用这个方法
|
||||
//taskLivingDetailsService.saveLogToFail(taskLivingDetail);
|
||||
//如果是重试 成功调这个方法
|
||||
//taskLivingDetailsService.saveLogFailToSuccess(taskLivingDetail);
|
||||
//如果是重试 失败调这个方法
|
||||
// taskLivingDetailsService.updateLogFailToSuccess(taskLivingDetail);
|
||||
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(reqParam).timeout(60000).execute().body();
|
||||
if (StrUtil.isNotEmpty(body)){
|
||||
JSONObject jsonObject = JSONObject.parseObject(body);
|
||||
Boolean flag = jsonObject.getBoolean("flag");
|
||||
//保存自定义项 标记推送状态
|
||||
order.setDataSourceCode(datasourceCode);
|
||||
//momOrderService.saveExtradefine(order);
|
||||
//保存日志
|
||||
IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity();
|
||||
taskLivingDetail.setCreate_time(new Date());
|
||||
taskLivingDetail.setModify_time(new Date());
|
||||
taskLivingDetail.setRootAppPk(order.getMoId());
|
||||
taskLivingDetail.setRootAppBill(order.getMocode());
|
||||
taskLivingDetail.setPluginId("kjsMomOrderPlugin");
|
||||
taskLivingDetail.setRootAppNewData(reqParam);
|
||||
taskLivingDetail.setNewTransmitInfo(body);
|
||||
this.saveLog(id,flag,taskLivingDetail);
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("生产订单同步wsm出错:{}",e);
|
||||
}
|
||||
|
|
|
@ -21,36 +21,32 @@
|
|||
<result property="itaxrate" column="itaxrate" />
|
||||
</resultMap>
|
||||
<sql id="DeliveryDetailEntity_Base_Column_List">
|
||||
dls.dlid,
|
||||
dls.cwhcode,
|
||||
dlid,
|
||||
cwhcode,
|
||||
cwhname,
|
||||
dls.cinvcode,
|
||||
dls.cinvname,
|
||||
cinvcode,
|
||||
cinvname,
|
||||
cinvstd,
|
||||
iquantity,
|
||||
inum,
|
||||
inv.ccomunitcode,
|
||||
comUnit.ccomunitname,
|
||||
ccomunitcode,
|
||||
ccomunitname,
|
||||
casscomunitcode,
|
||||
assUnit.ccomunitname as 'casscomunitname',
|
||||
casscomunitname,
|
||||
cmemo,
|
||||
irowno,
|
||||
iorderrowno,
|
||||
csocode,
|
||||
dls.itaxrate
|
||||
itaxrate
|
||||
</sql>
|
||||
|
||||
<select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.delivery.entity.DeliveryDetailEntity">
|
||||
select
|
||||
<include refid="DeliveryDetailEntity_Base_Column_List" />
|
||||
from DispatchLists dls
|
||||
left join Warehouse wh on wh.cWhCode = dls.cWhCode
|
||||
left join inventory inv on inv.cInvCode = dls.cInvCode
|
||||
left join ComputationUnit comUnit on comUnit.cComunitCode = inv.cComUnitCode
|
||||
left join ComputationUnit assUnit on assUnit.cComunitCode = inv.cAssComUnitCode
|
||||
from v_hzya_dispatchLists
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="dlid != null ">dls.DLID = #{dlid} </if>
|
||||
<if test="cwhcode != null and cwhcode !='' "> and dls.cwhcode = #{cwhcode} </if>
|
||||
<if test="dlid != null ">DLID = #{dlid} </if>
|
||||
<if test="cwhcode != null and cwhcode !='' "> and cwhcode = #{cwhcode} </if>
|
||||
</trim>
|
||||
order by dlid,irowno
|
||||
</select>
|
||||
|
|
|
@ -33,9 +33,20 @@ public class DeliveryOrderEntity extends BaseEntity {
|
|||
private String itaxrate;
|
||||
//备注
|
||||
private String cmemo;
|
||||
|
||||
//审核人
|
||||
private String cVerifier;
|
||||
//退货标记。 0发货 1退货
|
||||
private String bReturnFlag;
|
||||
//修改时间
|
||||
private String dmodifysystime;
|
||||
//推送状态字段
|
||||
private String pushFlagField;
|
||||
//帐套名
|
||||
private String dbname;
|
||||
|
||||
private String startTime;//定时任务执行时传入的开始时间
|
||||
private String endTime;//定时任务执行时传入的结束时间
|
||||
|
||||
public String getDlid() {
|
||||
return dlid;
|
||||
}
|
||||
|
@ -139,4 +150,51 @@ public class DeliveryOrderEntity extends BaseEntity {
|
|||
public void setbReturnFlag(String bReturnFlag) {
|
||||
this.bReturnFlag = bReturnFlag;
|
||||
}
|
||||
public String getDmodifysystime() {
|
||||
return dmodifysystime;
|
||||
}
|
||||
|
||||
public void setDmodifysystime(String dmodifysystime) {
|
||||
this.dmodifysystime = dmodifysystime;
|
||||
}
|
||||
|
||||
public String getPushFlagField() {
|
||||
return pushFlagField;
|
||||
}
|
||||
|
||||
public void setPushFlagField(String pushFlagField) {
|
||||
this.pushFlagField = pushFlagField;
|
||||
}
|
||||
|
||||
public String getDbname() {
|
||||
return dbname;
|
||||
}
|
||||
|
||||
public void setDbname(String dbname) {
|
||||
this.dbname = dbname;
|
||||
}
|
||||
|
||||
public String getcVerifier() {
|
||||
return cVerifier;
|
||||
}
|
||||
|
||||
public void setcVerifier(String cVerifier) {
|
||||
this.cVerifier = cVerifier;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
<result property="iexchrate" column="iexchrate" />
|
||||
<result property="itaxrate" column="itaxrate" />
|
||||
<result property="cmemo" column="cmemo" />
|
||||
<result property="dmodifysystime" column="dmodifysystime" />
|
||||
<result property="pushFlagField" column="pushFlagField" />
|
||||
<result property="dbname" column="dbname" />
|
||||
</resultMap>
|
||||
<sql id="DeliveryOrder_Base_Column_List">
|
||||
dlid,
|
||||
|
@ -27,13 +30,16 @@
|
|||
cexch_name,
|
||||
iexchrate,
|
||||
itaxrate,
|
||||
cmemo
|
||||
cmemo,
|
||||
dmodifysystime,
|
||||
pushFlagField,
|
||||
dbname
|
||||
</sql>
|
||||
|
||||
<select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity">
|
||||
select
|
||||
<include refid="DeliveryOrder_Base_Column_List" />
|
||||
from DispatchList
|
||||
from v_hzya_dispatchList
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="dlid != null ">dlid= #{dlid} </if>
|
||||
<if test="cdlcode != null and cdlcode !='' "> and cdlcode = #{cdlcode} </if>
|
||||
|
@ -41,7 +47,25 @@
|
|||
<if test="ccusname != null and ccusname !='' "> and ccusname = #{ccusname} </if>
|
||||
<if test="csocode != null and csocode !='' "> and csocode = #{csocode} </if>
|
||||
<if test="bReturnFlag != null and bReturnFlag !='' "> and bReturnFlag = #{bReturnFlag} </if>
|
||||
<if test="startTime != null and startTime !='' "> and dmodifysystime >= #{startTime} </if>
|
||||
<if test="endTime != null and endTime !='' "><![CDATA[ and dmodifysystime < #{endTime} ]]> </if>
|
||||
and cVerifier is not null
|
||||
</trim>
|
||||
order by dlid
|
||||
</select>
|
||||
|
||||
<!-- 保存扩展自定义项 -->
|
||||
<insert id="dispatchList_order_extradefine_insert" parameterType="com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity">
|
||||
insert into DispatchList_order_extradefine(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="dlid != null and dlid != ''">dlid,</if>
|
||||
<if test="pushFlagField != null and pushFlagField != ''">${pushFlagField},</if>
|
||||
</trim>
|
||||
)values (
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="dlid != null and dlid !='' "> #{dlid}, </if>
|
||||
<if test="pushFlagField != null and pushFlagField !='' "> '1' </if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
|
@ -9,4 +9,9 @@ import com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity;
|
|||
* @Date 2024/8/22 15:12
|
||||
**/
|
||||
public interface IDeliveryOrderService extends IBaseService<DeliveryOrderEntity,String> {
|
||||
/**
|
||||
* 保存自定义项
|
||||
* @param entity
|
||||
*/
|
||||
void saveExtradefine(DeliveryOrderEntity entity);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.u8.delivery.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.u8.delivery.dao.IDeliveryOrderDao;
|
||||
import com.hzya.frame.u8.delivery.entity.DeliveryOrderEntity;
|
||||
|
@ -24,4 +25,15 @@ public class DeliveryOrderServiceImpl extends BaseService<DeliveryOrderEntity,St
|
|||
this.deliveryOrderDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存自定义项
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
@Override
|
||||
@DS("#entity.dataSourceCode")
|
||||
public void saveExtradefine(DeliveryOrderEntity entity) {
|
||||
deliveryOrderDao.save("com.hzya.frame.u8.delivery.dao.impl.DeliveryOrderDaoImpl.dispatchList_order_extradefine_insert",entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,10 @@ public class MomOrderDetailEntity extends BaseEntity {
|
|||
private String mdeptname;
|
||||
//部门编码
|
||||
private String mdeptcode;
|
||||
|
||||
//审核人
|
||||
private String relsUser;
|
||||
//审核时间
|
||||
private String relsTime;
|
||||
public String getMoId() {
|
||||
return moId;
|
||||
}
|
||||
|
@ -88,4 +91,20 @@ public class MomOrderDetailEntity extends BaseEntity {
|
|||
public void setMdeptcode(String mdeptcode) {
|
||||
this.mdeptcode = mdeptcode;
|
||||
}
|
||||
|
||||
public String getRelsUser() {
|
||||
return relsUser;
|
||||
}
|
||||
|
||||
public void setRelsUser(String relsUser) {
|
||||
this.relsUser = relsUser;
|
||||
}
|
||||
|
||||
public String getRelsTime() {
|
||||
return relsTime;
|
||||
}
|
||||
|
||||
public void setRelsTime(String relsTime) {
|
||||
this.relsTime = relsTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,28 +10,30 @@
|
|||
<result property="auxqty" column="auxqty" />
|
||||
<result property="mdeptname" column="mdeptname" />
|
||||
<result property="mdeptcode" column="mdeptcode" />
|
||||
<result property="relsUser" column="relsUser" />
|
||||
<result property="relsTime" column="relsTime" />
|
||||
</resultMap>
|
||||
<sql id="MomOrderDetail_Base_Column_List">
|
||||
MoId,
|
||||
invCode as 'cinvcode',
|
||||
cinvcode,
|
||||
cinvname,
|
||||
cinvstd,
|
||||
qty,
|
||||
auxqty,
|
||||
dep.cDepName as 'mdeptname',
|
||||
mdeptcode
|
||||
mdeptname,
|
||||
mdeptcode,
|
||||
relsUser,
|
||||
relsTime
|
||||
</sql>
|
||||
|
||||
<select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.production.entity.MomOrderDetailEntity">
|
||||
select
|
||||
<include refid="MomOrderDetail_Base_Column_List" />
|
||||
from mom_orderdetail mos
|
||||
left join inventory inv on inv.cInvCode = mos.InvCode
|
||||
left join Department dep on dep.cDepCode = mos.MDeptCode
|
||||
from v_hzya_mom_orderdetail
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="moId != null ">moId= #{moId} </if>
|
||||
<if test="cinvcode != null and cinvcode !='' "> and mos.InvCode = #{cinvcode} </if>
|
||||
<if test="cinvname != null and cinvname !='' "> and inv.cinvname = #{cinvname} </if>
|
||||
<if test="cinvcode != null and cinvcode !='' "> and cinvcode = #{cinvcode} </if>
|
||||
<if test="cinvname != null and cinvname !='' "> and cinvname = #{cinvname} </if>
|
||||
</trim>
|
||||
order by moId
|
||||
</select>
|
||||
|
|
|
@ -12,11 +12,22 @@ public class MomOrderEntity extends BaseEntity {
|
|||
private String moId;
|
||||
//生产订单号
|
||||
private String mocode;
|
||||
//制单日期
|
||||
//制单时间
|
||||
private String createtime;
|
||||
//制单人
|
||||
private String createuser;
|
||||
|
||||
//创建日期
|
||||
private String createDate;
|
||||
//修改日期
|
||||
private String modifyDate;
|
||||
//修改时间
|
||||
private String modifytime;
|
||||
//推送状态字段
|
||||
private String pushFlagField;
|
||||
//帐套名
|
||||
private String dbname;
|
||||
private String startTime;//定时任务执行时传入的开始时间
|
||||
private String endTime;//定时任务执行时传入的结束时间
|
||||
public String getMoId() {
|
||||
return moId;
|
||||
}
|
||||
|
@ -48,4 +59,59 @@ public class MomOrderEntity extends BaseEntity {
|
|||
public void setCreateuser(String createuser) {
|
||||
this.createuser = createuser;
|
||||
}
|
||||
public String getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(String createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public String getModifyDate() {
|
||||
return modifyDate;
|
||||
}
|
||||
|
||||
public void setModifyDate(String modifyDate) {
|
||||
this.modifyDate = modifyDate;
|
||||
}
|
||||
|
||||
public String getModifytime() {
|
||||
return modifytime;
|
||||
}
|
||||
|
||||
public void setModifytime(String modifytime) {
|
||||
this.modifytime = modifytime;
|
||||
}
|
||||
|
||||
public String getPushFlagField() {
|
||||
return pushFlagField;
|
||||
}
|
||||
|
||||
public void setPushFlagField(String pushFlagField) {
|
||||
this.pushFlagField = pushFlagField;
|
||||
}
|
||||
|
||||
public String getDbname() {
|
||||
return dbname;
|
||||
}
|
||||
|
||||
public void setDbname(String dbname) {
|
||||
this.dbname = dbname;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,22 +6,44 @@
|
|||
<result property="mocode" column="mocode" />
|
||||
<result property="createtime" column="createtime" />
|
||||
<result property="createuser" column="createuser" />
|
||||
<result property="modifytime" column="modifytime" />
|
||||
<result property="pushFlagField" column="pushFlagField" />
|
||||
<result property="dbname" column="dbname" />
|
||||
</resultMap>
|
||||
<sql id="MomOrder_Base_Column_List">
|
||||
moId,
|
||||
mocode,
|
||||
createtime,
|
||||
createuser
|
||||
createuser,
|
||||
modifytime,
|
||||
pushFlagField,
|
||||
dbname
|
||||
</sql>
|
||||
|
||||
<select id="entity_list_base" resultMap="get-entity-result" parameterType="com.hzya.frame.u8.production.entity.MomOrderEntity">
|
||||
select
|
||||
<include refid="MomOrder_Base_Column_List" />
|
||||
from mom_order
|
||||
from v_hzya_mom_order
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="moId != null ">moId= #{moId} </if>
|
||||
<if test="mocode != null and mocode !='' "> and mocode = #{mocode} </if>
|
||||
<if test="startTime != null and startTime !='' "> and modifytime >= #{startTime} </if>
|
||||
<if test="endTime != null and endTime !='' "><![CDATA[ and modifytime < #{endTime} ]]> </if>
|
||||
</trim>
|
||||
order by moId
|
||||
</select>
|
||||
<!-- 保存扩展自定义项 -->
|
||||
<insert id="mom_order_extradefine_insert" parameterType="com.hzya.frame.u8.production.entity.MomOrderEntity">
|
||||
insert into mom_order_extradefine(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="moId != null and moId != ''">moId,</if>
|
||||
<if test="cdefineField != null and cdefineField != ''">${cdefineField},</if>
|
||||
</trim>
|
||||
)values (
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="moId != null and moId !='' "> #{moId}, </if>
|
||||
<if test="cdefineField != null and cdefineField !='' "> '1' </if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
|
@ -9,4 +9,11 @@ import com.hzya.frame.u8.production.entity.MomOrderEntity;
|
|||
* @Date 2024/8/23 08:54
|
||||
**/
|
||||
public interface IMomOrderService extends IBaseService<MomOrderEntity,String> {
|
||||
|
||||
/**
|
||||
* 保存自定义项
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
void saveExtradefine(MomOrderEntity entity);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.u8.production.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.u8.production.dao.IMomOrderDao;
|
||||
import com.hzya.frame.u8.production.entity.MomOrderEntity;
|
||||
|
@ -23,4 +24,16 @@ public class MomOrderServiceImpl extends BaseService<MomOrderEntity,String> impl
|
|||
this.momOrderDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存自定义项
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public void saveExtradefine(MomOrderEntity entity) {
|
||||
momOrderDao.save("com.hzya.frame.u8.production.dao.impl.MomOrderDaoImpl.mom_order_extradefine_insert",entity);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue