销售订单删除

This commit is contained in:
lvleigang 2024-11-26 09:33:51 +08:00
parent 4a3b47d6d5
commit 15c692f414
2 changed files with 130 additions and 0 deletions

View File

@ -112,5 +112,15 @@ public interface IEncapsulationService extends IBaseService<EncapsulationEntity,
**/
Object processingOrderDelete(JSONObject jsonObject);
SysExtensionApiEntity addProcessingOrderDelete(SysExtensionApiEntity jsonObject);
/**
* @param jsonObject
* @return java.lang.Object
* @Author lvleigang
* @Description 销售订单删除接口
* 1销售订单取消审批 8000350064 ,2销售订单删除 8000350065
* @Date 9:44 上午 2024/9/4
**/
Object xsddDelete(JSONObject jsonObject);
SysExtensionApiEntity addxsddDelete(SysExtensionApiEntity jsonObject);
}

View File

@ -1518,5 +1518,125 @@ public class EncapsulationImpl extends BaseService<EncapsulationEntity, String>
}
return entity;
}
/**
* @param object
* @return java.lang.Object
* @Author lvleigang
* @Description 销售订单删除接口 8000350082
* 1销售订单取消审批 8000350064 ,2销售订单删除 8000350065
* @Date 9:44 上午 2024/9/4
**/
@Override
public Object xsddDelete(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("xsddqxsp"))) {
returnObject.put("status", "falied");
returnObject.put("errormsg", "销售订单取消审批接口编号为空");
return returnObject;
}
if (!checkStr(jsonObject.getString("xsddsc"))) {
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;
}
//销售订单取消审批,,
String cgddqs = getsendBody("3", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp"));
JSONObject cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddqxsp"), jsonObject.getString("xsddqxsp").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("xsddsc"), jsonObject.getString("xsddsc").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 addxsddDelete(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("xsddqxsp",headers.get("xsddqxsp"));
jsonObject.put("xsddsc",headers.get("xsddsc"));
entity.setBodys(jsonObject.toJSONString());
}
} catch (Exception e) {
e.printStackTrace();
}
return entity;
}
}