添加删除委外订单接口
This commit is contained in:
parent
17d3a7c337
commit
038f3deda8
|
@ -14,7 +14,6 @@ import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTask
|
||||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
||||||
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
||||||
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogStatusEnum;
|
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogStatusEnum;
|
||||||
import com.hzya.frame.u8.util.U8Util;
|
|
||||||
import com.hzya.frame.uuid.UUIDLong;
|
import com.hzya.frame.uuid.UUIDLong;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
@ -203,7 +202,7 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("billid", formmain0225.getString("id"));
|
jsonObject.put("billid", formmain0225.getString("id"));
|
||||||
jsonObject.put("AccId", formmain0225.getString("field0020"));
|
jsonObject.put("AccId", formmain0225.getString("field0020"));
|
||||||
jsonObject.put("Token", U8Util.getToken());
|
//jsonObject.put("Token", U8Util.getToken());
|
||||||
JSONObject oArchives = new JSONObject();
|
JSONObject oArchives = new JSONObject();
|
||||||
oArchives.put("cVenCode", formmain0225.getString("field0002"));
|
oArchives.put("cVenCode", formmain0225.getString("field0002"));
|
||||||
oArchives.put("cVenName ", formmain0225.getString("field0003"));
|
oArchives.put("cVenName ", formmain0225.getString("field0003"));
|
||||||
|
|
|
@ -101,4 +101,16 @@ public interface IEncapsulationService extends IBaseService<EncapsulationEntity,
|
||||||
SysExtensionApiEntity addOtherWarehouseReceiptDelete(SysExtensionApiEntity jsonObject);
|
SysExtensionApiEntity addOtherWarehouseReceiptDelete(SysExtensionApiEntity jsonObject);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param jsonObject
|
||||||
|
* @return java.lang.Object
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 加工订单删除接口
|
||||||
|
* 0、根据加工订单号查询加工入库单号,1、加工入库单取消签字 ,2、加工入库删除 ,3、加工订单弃审 ,4、加工订单删除
|
||||||
|
* @Date 9:44 上午 2024/9/4
|
||||||
|
**/
|
||||||
|
Object processingOrderDelete(JSONObject jsonObject);
|
||||||
|
SysExtensionApiEntity addProcessingOrderDelete(SysExtensionApiEntity jsonObject);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -1346,4 +1347,176 @@ public class EncapsulationImpl extends BaseService<EncapsulationEntity, String>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param object
|
||||||
|
* @return java.lang.Object
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 委外订单删除接口 8000350092
|
||||||
|
* 0、根据委外订单号查询加工入库单号,1、委外加工入库单取消签字 8000350088 ,2、委外加工入库删除 8000350089,3、委外订单弃审 8000350090,4、委外订单删除 8000350091
|
||||||
|
* @Date 9:44 上午 2024/9/4
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public Object processingOrderDelete(JSONObject object) {
|
||||||
|
JSONObject returnObject = new JSONObject();
|
||||||
|
|
||||||
|
JSONObject jsonObject = getData("jsonStr", object, JSONObject.class);
|
||||||
|
//判断是否存在参数
|
||||||
|
if (!checkStr(jsonObject.getString("code"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "单据号为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("corp"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "公司为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("date_begin"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "单据开始日期为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("date_end"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "单据结束日期为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("coperator"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "操作员为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!checkStr(jsonObject.getString("wwjgrkqxqz"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "委外加工入库单取消签字接口编号为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("wwjgrksc"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "委外加工入库删除接口编号为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("wwddqs"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "委外订单弃审接口编号为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("wwddsc"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "委外订单删除接口编号为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!checkStr(jsonObject.getString("dataSourceCode"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "数据源编码为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("publicKey"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "publicKey为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
if (!checkStr(jsonObject.getString("secretKey"))) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "secretKey为空");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
//根据委外订单号查询委外加工入库单号
|
||||||
|
EncapsulationEntity encapsulationEntity = new EncapsulationEntity();
|
||||||
|
encapsulationEntity.setCode(jsonObject.getString("code"));
|
||||||
|
encapsulationEntity.setDataSourceCode(jsonObject.getString("dataSourceCode"));
|
||||||
|
encapsulationEntity.setCbilltypecode("47");
|
||||||
|
List<EncapsulationEntity> encapsulationEntities = encapsulationDao.queryCgrkddh(encapsulationEntity);
|
||||||
|
//List<EncapsulationEntity> encapsulationEntities = new ArrayList<>();
|
||||||
|
//EncapsulationEntity encapsulationEntity1 = new EncapsulationEntity();
|
||||||
|
//encapsulationEntity1.setCode("WW2411080010");
|
||||||
|
//encapsulationEntity1.setUnitcode("001");
|
||||||
|
//encapsulationEntities.add(encapsulationEntity1);
|
||||||
|
if(encapsulationEntities == null || encapsulationEntities.size() != 1){
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "查到委外加工入库错误");
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
//执行委外加工入库单取消签字接口
|
||||||
|
String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode(),encapsulationEntities.get(0).getUnitcode());
|
||||||
|
JSONObject cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("wwjgrkqxqz"), jsonObject.getString("wwjgrkqxqz").substring(0,6), cgrkdqxqz);
|
||||||
|
if (!cgrkdqxqzflag.getBoolean("flag")) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "委外加工入库单取消签字失败:"+cgrkdqxqzflag.getString("msg"));
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
//执行委外加工入库单删除
|
||||||
|
String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode(),encapsulationEntities.get(0).getUnitcode());
|
||||||
|
JSONObject cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("wwjgrksc"), jsonObject.getString("wwjgrksc").substring(0,6), cgrkdsc);
|
||||||
|
if (!cgrkdscfiag.getBoolean("flag")) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "委外加工入库单删除失败:"+cgrkdscfiag.getString("msg"));
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
//执行委外订单弃审
|
||||||
|
String cgddqs = getsendBody("3", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp"));
|
||||||
|
JSONObject cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("wwddqs"), jsonObject.getString("wwddqs").substring(0,6), cgddqs);
|
||||||
|
if (!cgddqsflag.getBoolean("flag")) {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "委外订单弃审失败:"+cgddqsflag.getString("msg"));
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
//执行委外订单删除
|
||||||
|
String cgddsc = getsendBody("4", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp"));
|
||||||
|
JSONObject cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("wwddsc"), jsonObject.getString("wwddsc").substring(0,6), cgddsc);
|
||||||
|
if (cgddscflag.getBoolean("flag")) {
|
||||||
|
returnObject.put("status", "success");
|
||||||
|
returnObject.put("errormsg", "委外订单删除成功");
|
||||||
|
return returnObject;
|
||||||
|
} else {
|
||||||
|
returnObject.put("status", "falied");
|
||||||
|
returnObject.put("errormsg", "委外订单删除失败:"+cgddscflag.getString("msg"));
|
||||||
|
return returnObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param entity
|
||||||
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 数据表
|
||||||
|
* @Date 11:52 上午 2024/3/27
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public SysExtensionApiEntity addProcessingOrderDelete(SysExtensionApiEntity entity) {
|
||||||
|
try {
|
||||||
|
Map<String, String> headers = entity.getHeaders();
|
||||||
|
SysApplicationEntity applicationEntity = entity.getReceiveApp();
|
||||||
|
SysApplicationDatabaseEntity sysApplicationDatabaseEntity = new SysApplicationDatabaseEntity();
|
||||||
|
sysApplicationDatabaseEntity.setSts("Y");
|
||||||
|
sysApplicationDatabaseEntity.setDbStatus("1");
|
||||||
|
sysApplicationDatabaseEntity.setAppId(applicationEntity.getId());
|
||||||
|
sysApplicationDatabaseEntity.setDataSourceCode("master");
|
||||||
|
List<SysApplicationDatabaseEntity> sysDataSourceEntities = sysApplicationDatabaseDao.queryDSBase(sysApplicationDatabaseEntity);
|
||||||
|
if(sysDataSourceEntities != null && sysDataSourceEntities.size() > 0){
|
||||||
|
String parm = entity.getBodys();
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(parm);
|
||||||
|
jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode());
|
||||||
|
jsonObject.put("publicKey",entity.getSendApp().getPublicKey());
|
||||||
|
jsonObject.put("secretKey",entity.getSendApp().getSecretKey());
|
||||||
|
|
||||||
|
jsonObject.put("wwjgrkqxqz",headers.get("wwjgrkqxqz"));
|
||||||
|
jsonObject.put("wwjgrksc",headers.get("wwjgrksc"));
|
||||||
|
jsonObject.put("wwddqs",headers.get("wwddqs"));
|
||||||
|
jsonObject.put("wwddsc",headers.get("wwddsc"));
|
||||||
|
entity.setBodys(jsonObject.toJSONString());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue