Merge branch 'dongj' of http://ufidahz.com.cn:9015/root/kangarooDataCenterV3 into dongj
This commit is contained in:
commit
45576106c7
|
@ -1009,6 +1009,18 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
|||
parameterJson.put("body",apiEntity.getBodyIn());
|
||||
parameterJson.put("query",apiEntity.getQueryIn());
|
||||
parameterJson.put("data",doObjects.get(i));
|
||||
//1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据
|
||||
MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity1 = new MdmModuleDistributeTripartiteEntity();
|
||||
mdmModuleDistributeTripartiteEntity1.setSts("Y");
|
||||
mdmModuleDistributeTripartiteEntity1.setMdmId(mdmId);
|
||||
mdmModuleDistributeTripartiteEntity1.setDataId(objects.get(i).getString("id"));
|
||||
mdmModuleDistributeTripartiteEntity1.setAppId(sysApplicationEntity.getId());
|
||||
mdmModuleDistributeTripartiteEntity1 = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity1);
|
||||
String tripartiteId = "";
|
||||
if(mdmModuleDistributeTripartiteEntity1 != null && mdmModuleDistributeTripartiteEntity1.getTripartiteId() != null ){
|
||||
tripartiteId = mdmModuleDistributeTripartiteEntity1.getTripartiteId();
|
||||
}
|
||||
parameterJson.put("tripartiteId", tripartiteId);
|
||||
/** head */
|
||||
Map<String, String> header = null;
|
||||
/** query */
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package com.hzya.frame.plugin.u8c.plugin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.base.PluginBaseEntity;
|
||||
import com.hzya.frame.plugin.u8c.service.ISalesBillingService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
||||
public class SalesBillingPluginInitializer extends PluginBaseEntity {
|
||||
Logger logger = LoggerFactory.getLogger(SalesBillingPluginInitializer.class);
|
||||
|
||||
@Autowired
|
||||
private ISalesBillingService salesBillingService;
|
||||
|
||||
/***
|
||||
* 插件初始化方法
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-02 10:48
|
||||
* @Param []
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public void initialize() {
|
||||
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件销毁方法
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public void destroy() {
|
||||
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的ID
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return "SalesBillingPlugin";
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的名称
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "u8c销售开票审核状态同步插件";
|
||||
}
|
||||
|
||||
/****
|
||||
* 插件的显示值
|
||||
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @date 2023-08-02 10:48
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public String getPluginLabel() {
|
||||
return "u8c销售开票审核状态同步插件";
|
||||
}
|
||||
|
||||
/***
|
||||
* 插件类型 1、场景插件
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-02 14:01
|
||||
* @Param []
|
||||
* @return java.lang.String
|
||||
**/
|
||||
@Override
|
||||
public String getPluginType() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
/***
|
||||
* 执行业务代码
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
* @Date 2023-08-07 11:20
|
||||
* @param requestJson 执行业务代码的参数
|
||||
* @return void
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
JsonResultEntity jsonResultEntity = salesBillingService.doSalesBilling(requestJson);
|
||||
return jsonResultEntity;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.hzya.frame.plugin.u8c.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
public interface ISalesBillingService {
|
||||
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description OA同步销售开票审核状态到U8C
|
||||
* @Date 10:21 上午 2024/8/2
|
||||
* @param requestJson
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
JsonResultEntity doSalesBilling(JSONObject requestJson);
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
package com.hzya.frame.plugin.u8c.service.impl;
|
||||
|
||||
import cn.hutool.core.map.MapBuilder;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.plugin.u8c.service.ISalesBillingService;
|
||||
import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity;
|
||||
import com.hzya.frame.u8c.salesBilling.service.IU8cSalesBillingService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class SalesBillingServiceImpl implements ISalesBillingService {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(SalesBillingServiceImpl.class);
|
||||
|
||||
@Value("${OA.data_source_code}")
|
||||
private String oa_data_source_code;
|
||||
@Autowired
|
||||
private IU8cSalesBillingService iu8cSalesBillingService;
|
||||
|
||||
private final String appId = "800035";
|
||||
private final String apiCode = "8000350047";
|
||||
private final String publicKey = "ZJYATW/MfYZX7zF0eAh4DJXbyTLwUtwSoSz5Y/o1ksAaN/dCe7eDIk+3zDUT+v578prj";
|
||||
private final String secretKey = "+5BUkLQh3iX3VHgEt5bE2IPh+ZeebGvDaEspsvVu739Ar6sFnwg+fpPod4t6XhoTj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=";
|
||||
|
||||
/**
|
||||
* @param requestJson
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 同步销售开票审核状态
|
||||
* @Date 10:21 上午 2024/8/2
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity doSalesBilling(JSONObject requestJson) {
|
||||
//查询需要同步的数据
|
||||
|
||||
try {
|
||||
U8cSalesBillingEntity u8cSalesBillingEntity = new U8cSalesBillingEntity();
|
||||
u8cSalesBillingEntity.setDataSourceCode(oa_data_source_code);
|
||||
List<U8cSalesBillingEntity> u8cSalesBillingEntities = iu8cSalesBillingService.queryDoSalesBilling(u8cSalesBillingEntity);
|
||||
|
||||
if (u8cSalesBillingEntities != null && u8cSalesBillingEntities.size() > 0) {
|
||||
for (int i = 0; i < u8cSalesBillingEntities.size(); i++) {
|
||||
U8cSalesBillingEntity entity = u8cSalesBillingEntities.get(i);
|
||||
String params = getSendData(entity);
|
||||
//发送数据
|
||||
String returnData = executeEsb(params,appId,apiCode,publicKey,secretKey);
|
||||
//解析结果
|
||||
boolean flag = analyzeReturnData(returnData);
|
||||
if(flag){
|
||||
entity.setPushStatus("Y");
|
||||
}else {
|
||||
entity.setPushStatus("N");
|
||||
}
|
||||
entity.setDataSourceCode(oa_data_source_code);
|
||||
iu8cSalesBillingService.updateDoSalesBilling(entity);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("同步销售开票审核状态成功");
|
||||
} else {
|
||||
return BaseResult.getSuccessMessageEntity("同步销售开票审核状态成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity("同步销售开票审核状态失败" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 解析返回状态
|
||||
* @Date 2:50 下午 2024/8/2
|
||||
* @param returnData
|
||||
* @return boolean
|
||||
**/
|
||||
private boolean analyzeReturnData(String returnData) {
|
||||
boolean falg = false ;
|
||||
if (JSONUtil.isTypeJSON(returnData)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(returnData);
|
||||
if(jsonObject != null && jsonObject.get("flag") != null && jsonObject.getBoolean("flag")) {
|
||||
JSONObject attribute = jsonObject.getJSONObject("attribute");
|
||||
if(attribute != null && attribute.get("status") != null && "success".equals(attribute.getString("status"))) {
|
||||
falg = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return falg;
|
||||
}
|
||||
|
||||
private String getSendData(U8cSalesBillingEntity entity) {
|
||||
String params = "";
|
||||
//{
|
||||
// "queryinfo": {
|
||||
// "code": [
|
||||
// "SITH1904180026",
|
||||
// "SOTH1805240023"
|
||||
// ],
|
||||
// "corp": "1000",
|
||||
// "date_begin": "2019-03-24",
|
||||
// "date_end": "2019-05-24"
|
||||
// },
|
||||
// "approveinfo": {
|
||||
// "approvid": "18612329914",
|
||||
// "approveDate": "2018-04-19",
|
||||
// "status": "Y",
|
||||
// "note": "哈哈"
|
||||
// }
|
||||
//}
|
||||
JSONObject data = new JSONObject();
|
||||
JSONObject queryinfo = new JSONObject();
|
||||
JSONObject approveinfo = new JSONObject();
|
||||
JSONArray code = new JSONArray();
|
||||
code.add(entity.getCode());//单据号
|
||||
queryinfo.put("code", code);
|
||||
queryinfo.put("corp", entity.getCorp());//公司编码
|
||||
queryinfo.put("date_begin", entity.getDateBegin());//单据开始日期
|
||||
queryinfo.put("date_end", entity.getDateEnd());//单据结束日期
|
||||
approveinfo.put("approvid", entity.getApprovid());//审批人
|
||||
approveinfo.put("approveDate", entity.getApprovedate());//审核时间
|
||||
approveinfo.put("status", entity.getStatus());//审批状态(Y:通过,N:不通过,R:驳回)
|
||||
approveinfo.put("note", entity.getNote());//批语
|
||||
|
||||
data.put("queryinfo", queryinfo);
|
||||
data.put("approveinfo", approveinfo);
|
||||
params = data.toJSONString();
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
public String executeEsb(String params, String appId, String apiCode, String publicKey, String secretKey) {
|
||||
logger.info("请求apiCode:{},参数:{}", apiCode, params);
|
||||
Map<String, String> header = MapBuilder.<String, String>create(true)
|
||||
.put("apiCode", apiCode)
|
||||
.put("publicKey", publicKey)
|
||||
.put("secretKey", secretKey)
|
||||
.put("appId", appId)
|
||||
.build();
|
||||
String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body();
|
||||
return res;
|
||||
}
|
||||
}
|
|
@ -49,4 +49,4 @@ cbs8:
|
|||
#电子回单下载临时存放位置
|
||||
elec_path: /Users/xiangerlin/Downloads/
|
||||
OA:
|
||||
data_source_code: yc_oa
|
||||
data_source_code: djoatest
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>SalesBillingPlugin</id>
|
||||
<name>u8c插件</name>
|
||||
<category>202408020001</category>
|
||||
</plugin>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="salesBillingPluginInitializer" class="com.hzya.frame.plugin.u8c.plugin.SalesBillingPluginInitializer" />
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="salesBillingServiceImpl" class="com.hzya.frame.plugin.u8c.service.impl.SalesBillingServiceImpl" />
|
||||
</beans>
|
|
@ -51,6 +51,7 @@ public class GroovyUtil {
|
|||
logger.info("创建newInstance失败:"+ e);
|
||||
throw new BaseSystemException(e);
|
||||
}
|
||||
logger.info("开始执行脚本:"+parameterJson);
|
||||
Object returnObj = groovyObject.invokeMethod("execute",parameterJson);
|
||||
logger.info("执行脚本结束:"+returnObj);
|
||||
return returnObj;
|
||||
|
|
|
@ -206,11 +206,24 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
}
|
||||
}
|
||||
if(jsonObjectMain!=null && jsonObjectMain.size()>0) {
|
||||
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
||||
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
||||
List<List<Map<String, Object>>> mapDetails = new ArrayList<>();//将子表数据存到map中
|
||||
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
||||
map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity);
|
||||
|
||||
//根据data_id判断数据是否已经保存在相关表中,避免重复保存
|
||||
List<String> fields = getFields(comparisonEntity);
|
||||
Map<String,Object> mapDataId=new HashMap<>();
|
||||
mapDataId.put("data_id",jsonObjectMain.getString("data_id"));
|
||||
ComparisonEntity comparisonDataId=new ComparisonEntity();
|
||||
comparisonDataId.setMap(mapDataId);
|
||||
comparisonDataId.setDbName(comparisonEntity.getDbName());
|
||||
comparisonDataId.setFields(fields);
|
||||
List<Map<String, Object>> listDataId = comparisonDao.queryComparisonPage(comparisonDataId);
|
||||
if(CollectionUtils.isNotEmpty(listDataId)){
|
||||
return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据");
|
||||
}
|
||||
|
||||
//判断输入的主表字段是否是必填项
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//如果必填字段不为空
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,20 @@
|
|||
package com.hzya.frame.u8c.salesBilling.dao;
|
||||
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 脚本表(u8c_sales_billing: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-08-02 11:07:43
|
||||
*/
|
||||
public interface IU8cSalesBillingDao extends IBaseDao<U8cSalesBillingEntity, String> {
|
||||
List<U8cSalesBillingEntity> queryDoSalesBilling(U8cSalesBillingEntity entity);
|
||||
|
||||
int updateDoSalesBilling(U8cSalesBillingEntity entity);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.u8c.salesBilling.dao.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.u8c.salesBilling.dao.IU8cSalesBillingDao;
|
||||
import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository(value = "U8cSalesBillingDaoImpl")
|
||||
public class U8cSalesBillingDaoImpl extends MybatisGenericDao<U8cSalesBillingEntity, String> implements IU8cSalesBillingDao{
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public List<U8cSalesBillingEntity> queryDoSalesBilling(U8cSalesBillingEntity entity) {
|
||||
List<U8cSalesBillingEntity> o = (List<U8cSalesBillingEntity>) super.selectList(getSqlIdPrifx() + "queryDoSalesBilling", entity);
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public int updateDoSalesBilling(U8cSalesBillingEntity entity) {
|
||||
Integer o = super.update(getSqlIdPrifx() + "updateDoSalesBilling", entity);
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package com.hzya.frame.u8c.salesBilling.entity;
|
||||
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
public class U8cSalesBillingEntity extends BaseEntity {
|
||||
|
||||
/** 单据号 */
|
||||
private String code;
|
||||
/** 公司编码 */
|
||||
private String corp;
|
||||
/** 单据开始日期 */
|
||||
private String dateBegin;
|
||||
/** 单据结束日期 */
|
||||
private String dateEnd;
|
||||
/** 审批人 */
|
||||
private String approvid;
|
||||
/** 审核时间 */
|
||||
private String approvedate;
|
||||
/** 审批状态(Y:通过,N:不通过,R:驳回) */
|
||||
private String status;
|
||||
/** 批语 */
|
||||
private String note;
|
||||
//数据源
|
||||
private String dataSourceCode;
|
||||
//推送状态 Y成功N失败
|
||||
private String pushStatus;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCorp() {
|
||||
return corp;
|
||||
}
|
||||
|
||||
public void setCorp(String corp) {
|
||||
this.corp = corp;
|
||||
}
|
||||
|
||||
public String getDateBegin() {
|
||||
return dateBegin;
|
||||
}
|
||||
|
||||
public void setDateBegin(String dateBegin) {
|
||||
this.dateBegin = dateBegin;
|
||||
}
|
||||
|
||||
public String getDateEnd() {
|
||||
return dateEnd;
|
||||
}
|
||||
|
||||
public void setDateEnd(String dateEnd) {
|
||||
this.dateEnd = dateEnd;
|
||||
}
|
||||
|
||||
public String getApprovid() {
|
||||
return approvid;
|
||||
}
|
||||
|
||||
public void setApprovid(String approvid) {
|
||||
this.approvid = approvid;
|
||||
}
|
||||
|
||||
public String getApprovedate() {
|
||||
return approvedate;
|
||||
}
|
||||
|
||||
public void setApprovedate(String approvedate) {
|
||||
this.approvedate = approvedate;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDataSourceCode() {
|
||||
return dataSourceCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDataSourceCode(String dataSourceCode) {
|
||||
this.dataSourceCode = dataSourceCode;
|
||||
}
|
||||
|
||||
public String getPushStatus() {
|
||||
return pushStatus;
|
||||
}
|
||||
|
||||
public void setPushStatus(String pushStatus) {
|
||||
this.pushStatus = pushStatus;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?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.u8c.salesBilling.dao.impl.U8cSalesBillingDaoImpl">
|
||||
|
||||
<resultMap id="get-U8cSalesBillingEntity-result" type="com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity" >
|
||||
<result property="code" column="code" jdbcType="VARCHAR"/>
|
||||
<result property="corp" column="corp" jdbcType="VARCHAR"/>
|
||||
<result property="dateBegin" column="date_begin" jdbcType="VARCHAR"/>
|
||||
<result property="dateEnd" column="date_end" jdbcType="VARCHAR"/>
|
||||
<result property="approvid" column="approvid" jdbcType="VARCHAR"/>
|
||||
<result property="approvedate" column="approveDate" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="note" column="note" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryDoSalesBilling" resultType="com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity" parameterType = "com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity">
|
||||
SELECT
|
||||
formmain_0049.id as id,
|
||||
formmain_0049.field0001 as code, -- 单据号
|
||||
formmain_0049.field0045 as corp, -- 公司编码
|
||||
CONVERT(varchar,formmain_0049.start_date, 23) as dateBegin,-- 单据开始日期
|
||||
CONVERT(varchar,formmain_0049.modify_date, 23) as dateEnd, -- 单据结束日期
|
||||
'15639671252' as approvid, -- 审批人
|
||||
CONVERT(varchar,formmain_0049.modify_date, 23) as approvedate, -- 审核时间
|
||||
case when COL_SUMMARY.STATE = '1' then 'R' when COL_SUMMARY.STATE = '3' then 'Y' ELSE 'Y' END as status, -- 审批状态(Y:通过,N:不通过,R:驳回)
|
||||
'已阅' as note -- 批语
|
||||
FROM
|
||||
formmain_0049
|
||||
LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0049.id
|
||||
WHERE formmain_0049.field0044 is NULL and COL_SUMMARY.STATE in ( '1','3','0')
|
||||
</select>
|
||||
<update id="updateDoSalesBilling" parameterType="com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity">
|
||||
update formmain_0049 set
|
||||
field0044 = #{pushStatus}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.u8c.salesBilling.service;
|
||||
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||
import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IU8cSalesBillingService extends IBaseService<U8cSalesBillingEntity, String> {
|
||||
List<U8cSalesBillingEntity> queryDoSalesBilling(U8cSalesBillingEntity u8cSalesBillingEntity);
|
||||
|
||||
int updateDoSalesBilling(U8cSalesBillingEntity entity);
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.hzya.frame.u8c.salesBilling.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||
import com.hzya.frame.u8c.salesBilling.dao.IU8cSalesBillingDao;
|
||||
import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity;
|
||||
import com.hzya.frame.u8c.salesBilling.service.IU8cSalesBillingService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service(value = "u8cSalesBillingService")
|
||||
public class U8cSalesBillingServiceImpl extends BaseService<U8cSalesBillingEntity, String> implements IU8cSalesBillingService {
|
||||
|
||||
private IU8cSalesBillingDao u8cSalesBillingDao;
|
||||
|
||||
@Autowired
|
||||
public void setU8cSalesBillingDao(IU8cSalesBillingDao dao) {
|
||||
this.u8cSalesBillingDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
@Override
|
||||
public List<U8cSalesBillingEntity> queryDoSalesBilling(U8cSalesBillingEntity entity) {
|
||||
List<U8cSalesBillingEntity> u8cSalesBillingEntityList = u8cSalesBillingDao.queryDoSalesBilling(entity);
|
||||
return u8cSalesBillingEntityList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDoSalesBilling(U8cSalesBillingEntity entity) {
|
||||
return u8cSalesBillingDao.updateDoSalesBilling(entity);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue