Conflicts:
	pom.xml
This commit is contained in:
lvleigang 2024-09-14 14:24:53 +08:00
commit a16b05a9a2
87 changed files with 7642 additions and 5 deletions

View File

@ -71,11 +71,11 @@
<version>${revision}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hzya.frame</groupId>-->
<!-- <artifactId>fw-u9c</artifactId>-->
<!-- <version>${revision}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>fw-u9c</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>

48
fw-u9c/pom.xml Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>kangarooDataCenterV3</artifactId>
<groupId>com.hzya.frame</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fw-u9c</artifactId>
<packaging>jar</packaging>
<version>${revision}</version>
<dependencies>
<dependency>
<groupId>com.hzya.frame</groupId>
<artifactId>base-service</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法为了解决Unable to find main class的问题 -->
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
<skip>true</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u9c.allot.items.dao;
import com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (v_u9c_allot_order_items: table)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-02 10:52:57
*/
public interface IVU9cAllotOrderItemsDao extends IBaseDao<VU9cAllotOrderItemsEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.u9c.allot.items.dao.impl;
import com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity;
import com.hzya.frame.u9c.allot.items.dao.IVU9cAllotOrderItemsDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (VU9cAllotOrderItems)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-02 10:52:59
*/
@Repository("VU9cAllotOrderItemsDaoImpl")
public class VU9cAllotOrderItemsDaoImpl extends MybatisGenericDao<VU9cAllotOrderItemsEntity, String> implements IVU9cAllotOrderItemsDao{
}

View File

@ -0,0 +1,129 @@
package com.hzya.frame.u9c.allot.items.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cAllotOrderItems)实体类
*
* @author xiang2lin
* @since 2023-11-17 10:35:25
*/
public class VU9cAllotOrderItemsEntity extends BaseEntity {
private String reabamWcode;//睿本云从仓库
private String reabamUnit;//睿本云单位
private String unit_name;//采购单位
private String quantity1;//实到数量1
private String sortno;
private String skubarcode;
private String itemname;
private String itemcode;
private String quantity;
private String saleprice;
private String locationcode;
private String locationname;
public String getSortno() {
return sortno;
}
public void setSortno(String sortno) {
this.sortno = sortno;
}
public String getSkubarcode() {
return skubarcode;
}
public void setSkubarcode(String skubarcode) {
this.skubarcode = skubarcode;
}
public String getItemname() {
return itemname;
}
public void setItemname(String itemname) {
this.itemname = itemname;
}
public String getItemcode() {
return itemcode;
}
public void setItemcode(String itemcode) {
this.itemcode = itemcode;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getSaleprice() {
return saleprice;
}
public void setSaleprice(String saleprice) {
this.saleprice = saleprice;
}
public String getLocationcode() {
return locationcode;
}
public void setLocationcode(String locationcode) {
this.locationcode = locationcode;
}
public String getLocationname() {
return locationname;
}
public void setLocationname(String locationname) {
this.locationname = locationname;
}
public String getReabamWcode() {
return reabamWcode;
}
public void setReabamWcode(String reabamWcode) {
this.reabamWcode = reabamWcode;
}
public String getUnit_name() {
return unit_name;
}
public void setUnit_name(String unit_name) {
this.unit_name = unit_name;
}
public String getQuantity1() {
return quantity1;
}
public void setQuantity1(String quantity1) {
this.quantity1 = quantity1;
}
public String getReabamUnit() {
return reabamUnit;
}
public void setReabamUnit(String reabamUnit) {
this.reabamUnit = reabamUnit;
}
}

View File

@ -0,0 +1,136 @@
<?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.u9c.allot.items.dao.impl.VU9cAllotOrderItemsDaoImpl">
<resultMap id="get-VU9cAllotOrderItemsEntity-result" type="com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="sortno" column="sortno" jdbcType="VARCHAR"/>
<result property="reabamWcode" column="reabamWcode" jdbcType="VARCHAR"/>
<result property="skubarcode" column="skuBarcode" jdbcType="VARCHAR"/>
<result property="itemname" column="itemName" jdbcType="VARCHAR"/>
<result property="itemcode" column="itemCode" jdbcType="VARCHAR"/>
<result property="quantity" column="quantity" jdbcType="VARCHAR"/>
<result property="quantity1" column="quantity1" jdbcType="VARCHAR"/>
<result property="reabamUnit" column="reabamUnit" jdbcType="VARCHAR"/>
<result property="unit_name" column="unit_name" jdbcType="VARCHAR"/>
<result property="saleprice" column="salePrice" jdbcType="VARCHAR"/>
<result property="locationcode" column="locationCode" jdbcType="VARCHAR"/>
<result property="locationname" column="locationName" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cAllotOrderItemsEntity_Base_Column_List">
id,
sortno
,skuBarcode
,reabamWcode
,itemName
,itemCode
,quantity
,quantity1
,reabamUnit
,unit_name
,salePrice
,locationCode
,locationName
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-VU9cAllotOrderItemsEntity-result" parameterType = "com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity">
select
<include refid="VU9cAllotOrderItemsEntity_Base_Column_List" />
from v_u9c_allot_order_items
<trim prefix="where" prefixOverrides="and">
<if test="sortno != null and sortno != ''"> and sortno = #{sortno} </if>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="skubarcode != null and skubarcode != ''"> and skuBarcode = #{skubarcode} </if>
<if test="reabamWcode != null and reabamWcode != ''"> and reabamWcode = #{reabamWcode} </if>
<if test="itemname != null and itemname != ''"> and itemName = #{itemname} </if>
<if test="itemcode != null and itemcode != ''"> and itemCode = #{itemcode} </if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity} </if>
<if test="saleprice != null and saleprice != ''"> and salePrice = #{saleprice} </if>
<if test="locationcode != null and locationcode != ''"> and locationCode = #{locationcode} </if>
<if test="locationname != null and locationname != ''"> and locationName = #{locationname} </if>
</trim>
</select>
<!-- 睿本云专用 -->
<select id="VU9cAllotOrderItemsEntity_list_base_reabam" resultMap="get-VU9cAllotOrderItemsEntity-result" parameterType = "com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity">
select
<include refid="VU9cAllotOrderItemsEntity_Base_Column_List" />
from v_u9c_allot_order_items
<trim prefix="where" prefixOverrides="and">
<if test="sortno != null and sortno != ''"> and sortno = #{sortno} </if>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="skubarcode != null and skubarcode != ''"> and skuBarcode = #{skubarcode} </if>
<if test="reabamWcode != null and reabamWcode != ''"> and reabamWcode = #{reabamWcode} </if>
<if test="itemname != null and itemname != ''"> and itemName = #{itemname} </if>
<if test="itemcode != null and itemcode != ''"> and itemCode = #{itemcode} </if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity} </if>
<if test="saleprice != null and saleprice != ''"> and salePrice = #{saleprice} </if>
<if test="locationcode != null and locationcode != ''"> and locationCode = #{locationcode} </if>
<if test="locationname != null and locationname != ''"> and locationName = #{locationname} </if>
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity">
select count(1) from v_u9c_allot_order_items
<trim prefix="where" prefixOverrides="and">
<if test="sortno != null and sortno != ''"> and sortno = #{sortno} </if>
<if test="skubarcode != null and skubarcode != ''"> and skuBarcode = #{skubarcode} </if>
<if test="itemname != null and itemname != ''"> and itemName = #{itemname} </if>
<if test="itemcode != null and itemcode != ''"> and itemCode = #{itemcode} </if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity} </if>
<if test="saleprice != null and saleprice != ''"> and salePrice = #{saleprice} </if>
<if test="locationcode != null and locationcode != ''"> and locationCode = #{locationcode} </if>
<if test="locationname != null and locationname != ''"> and locationName = #{locationname} </if>
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VU9cAllotOrderItemsEntity-result" parameterType = "com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity">
select
<include refid="VU9cAllotOrderItemsEntity_Base_Column_List" />
from v_u9c_allot_order_items
<trim prefix="where" prefixOverrides="and">
<if test="sortno != null and sortno != ''"> and sortno like concat('%',#{sortno},'%') </if>
<if test="skubarcode != null and skubarcode != ''"> and skuBarcode like concat('%',#{skubarcode},'%') </if>
<if test="itemname != null and itemname != ''"> and itemName like concat('%',#{itemname},'%') </if>
<if test="itemcode != null and itemcode != ''"> and itemCode like concat('%',#{itemcode},'%') </if>
<if test="quantity != null and quantity != ''"> and quantity like concat('%',#{quantity},'%') </if>
<if test="saleprice != null and saleprice != ''"> and salePrice like concat('%',#{saleprice},'%') </if>
<if test="locationcode != null and locationcode != ''"> and locationCode like concat('%',#{locationcode},'%') </if>
<if test="locationname != null and locationname != ''"> and locationName like concat('%',#{locationname},'%') </if>
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="VU9cAllotOrderItemsentity_list_or" resultMap="get-VU9cAllotOrderItemsEntity-result" parameterType = "com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity">
select
<include refid="VU9cAllotOrderItemsEntity_Base_Column_List" />
from v_u9c_allot_order_items
<trim prefix="where" prefixOverrides="and">
<if test="sortno != null and sortno != ''"> or sortno = #{sortno} </if>
<if test="skubarcode != null and skubarcode != ''"> or skuBarcode = #{skubarcode} </if>
<if test="itemname != null and itemname != ''"> or itemName = #{itemname} </if>
<if test="itemcode != null and itemcode != ''"> or itemCode = #{itemcode} </if>
<if test="quantity != null and quantity != ''"> or quantity = #{quantity} </if>
<if test="saleprice != null and saleprice != ''"> or salePrice = #{saleprice} </if>
<if test="locationcode != null and locationcode != ''"> or locationCode = #{locationcode} </if>
<if test="locationname != null and locationname != ''"> or locationName = #{locationname} </if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,21 @@
package com.hzya.frame.u9c.allot.items.service;
import com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
/**
* (VU9cAllotOrderItems)表服务接口
*
* @author xiang2lin
* @since 2023-11-02 10:53:00
*/
public interface IVU9cAllotOrderItemsService extends IBaseService<VU9cAllotOrderItemsEntity, String>{
/**
* 查询U9C 收货单 传递睿本云专用
* @param entity
* @return
*/
List<VU9cAllotOrderItemsEntity> query2Reabam(VU9cAllotOrderItemsEntity entity);
}

View File

@ -0,0 +1,44 @@
package com.hzya.frame.u9c.allot.items.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.allot.items.entity.VU9cAllotOrderItemsEntity;
import com.hzya.frame.u9c.allot.items.dao.IVU9cAllotOrderItemsDao;
import com.hzya.frame.u9c.allot.items.service.IVU9cAllotOrderItemsService;
import com.hzya.frame.u9c.constant.U9Constant;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* (VU9cAllotOrderItems)表服务实现类
*
* @author xiang2lin
* @since 2023-11-02 10:53:01
*/
@Service("vU9cAllotOrderItemsService")
public class VU9cAllotOrderItemsServiceImpl extends BaseService<VU9cAllotOrderItemsEntity, String> implements IVU9cAllotOrderItemsService {
private IVU9cAllotOrderItemsDao vU9cAllotOrderItemsDao;
@Autowired
public void setVU9cAllotOrderItemsDao(IVU9cAllotOrderItemsDao dao) {
this.vU9cAllotOrderItemsDao = dao;
this.dao = dao;
}
/**
* 查询U9C 收货单 传递睿本云专用
*
* @param entity
* @return
*/
@DS(U9Constant.DATA_SOURCE_CODE)
@Override
public List<VU9cAllotOrderItemsEntity> query2Reabam(VU9cAllotOrderItemsEntity entity) {
List<VU9cAllotOrderItemsEntity> list = vU9cAllotOrderItemsDao.queryList(entity, "VU9cAllotOrderItemsEntity_list_base_reabam");
return list;
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u9c.allot.order.dao;
import com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (v_u9c_allot_order: table)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-02 10:52:19
*/
public interface IVU9cAllotOrderDao extends IBaseDao<VU9cAllotOrderEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.u9c.allot.order.dao.impl;
import com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity;
import com.hzya.frame.u9c.allot.order.dao.IVU9cAllotOrderDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (VU9cAllotOrder)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-02 10:52:21
*/
@Repository("VU9cAllotOrderDaoImpl")
public class VU9cAllotOrderDaoImpl extends MybatisGenericDao<VU9cAllotOrderEntity, String> implements IVU9cAllotOrderDao{
}

View File

@ -0,0 +1,101 @@
package com.hzya.frame.u9c.allot.order.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cAllotOrder)实体类
*
* @author xiang2lin
* @since 2023-11-17 10:23:58
*/
public class VU9cAllotOrderEntity extends BaseEntity {
private String doctypename;//单据类型
private String doctypecode;//单据类型编码
private String outorderno;
private String reasoncode;
private String docdate;//单据日期
private String wdata;//入库日期
private String remark;
private String status;// 5表示以关闭
private String update_time;
public String getOutorderno() {
return outorderno;
}
public void setOutorderno(String outorderno) {
this.outorderno = outorderno;
}
public String getReasoncode() {
return reasoncode;
}
public void setReasoncode(String reasoncode) {
this.reasoncode = reasoncode;
}
public String getDocdate() {
return docdate;
}
public void setDocdate(String docdate) {
this.docdate = docdate;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getWdata() {
return wdata;
}
public void setWdata(String wdata) {
this.wdata = wdata;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getUpdate_time() {
return update_time;
}
public void setUpdate_time(String update_time) {
this.update_time = update_time;
}
public String getDoctypename() {
return doctypename;
}
public void setDoctypename(String doctypename) {
this.doctypename = doctypename;
}
public String getDoctypecode() {
return doctypecode;
}
public void setDoctypecode(String doctypecode) {
this.doctypecode = doctypecode;
}
}

View File

@ -0,0 +1,101 @@
<?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.u9c.allot.order.dao.impl.VU9cAllotOrderDaoImpl">
<resultMap id="get-VU9cAllotOrderEntity-result" type="com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="outorderno" column="outOrderNo" jdbcType="VARCHAR"/>
<result property="doctypename" column="doctypename" jdbcType="VARCHAR"/>
<result property="doctypecode" column="doctypecode" jdbcType="VARCHAR"/>
<result property="docdate" column="docDate" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="update_time" column="update_time" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cAllotOrderEntity_Base_Column_List">
id,
outOrderNo,
doctypename,
doctypecode,
status,
update_time,
docDate
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-VU9cAllotOrderEntity-result" parameterType = "com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity">
select
<include refid="VU9cAllotOrderEntity_Base_Column_List" />
from v_u9c_allot_order
<trim prefix="where" prefixOverrides="and">
<if test="outorderno != null and outorderno != ''"> and outOrderNo = #{outorderno} </if>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="update_time != null and update_time != ''"> and update_time = #{update_time} </if>
<if test="docdate != null and docdate != ''"> and docDate = #{docdate} </if>
</trim>
</select>
<!--睿本云专用-->
<select id="VU9cAllotOrderEntity_list_base_reabam" resultMap="get-VU9cAllotOrderEntity-result" parameterType = "com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity">
select
<include refid="VU9cAllotOrderEntity_Base_Column_List" />
from v_u9c_allot_order
<trim prefix="where" prefixOverrides="and">
<if test="outorderno != null and outorderno != ''"> and outOrderNo = #{outorderno} </if>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="update_time != null and update_time != ''"> and update_time >= #{update_time} </if>
<if test="docdate != null and docdate != ''"> and docDate = #{docdate} </if>
<if test="doctypecode != null and doctypecode != ''"> and doctypecode = #{doctypecode} </if>
<if test="doctypename != null and doctypename != ''"> and doctypename = #{doctypename} </if>
and status = 5
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity">
select count(1) from v_u9c_allot_order
<trim prefix="where" prefixOverrides="and">
<if test="outorderno != null and outorderno != ''"> and outOrderNo = #{outorderno} </if>
<if test="docdate != null and docdate != ''"> and docDate = #{docdate} </if>
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VU9cAllotOrderEntity-result" parameterType = "com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity">
select
<include refid="VU9cAllotOrderEntity_Base_Column_List" />
from v_u9c_allot_order
<trim prefix="where" prefixOverrides="and">
<if test="outorderno != null and outorderno != ''"> and outOrderNo like concat('%',#{outorderno},'%') </if>
<if test="docdate != null and docdate != ''"> and docDate like concat('%',#{docdate},'%') </if>
<if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="VU9cAllotOrderentity_list_or" resultMap="get-VU9cAllotOrderEntity-result" parameterType = "com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity">
select
<include refid="VU9cAllotOrderEntity_Base_Column_List" />
from v_u9c_allot_order
<trim prefix="where" prefixOverrides="and">
<if test="outorderno != null and outorderno != ''"> or outOrderNo = #{outorderno} </if>
<if test="docdate != null and docdate != ''"> or docDate = #{docdate} </if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,22 @@
package com.hzya.frame.u9c.allot.order.service;
import com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
/**
* (VU9cAllotOrder)表服务接口
*
* @author xiang2lin
* @since 2023-11-02 10:52:22
*/
public interface IVU9cAllotOrderService extends IBaseService<VU9cAllotOrderEntity, String>{
/**
* 查询收货单推送睿本云专用
* @param entity
* @return
*/
List<VU9cAllotOrderEntity> query2Reabam(VU9cAllotOrderEntity entity);
}

View File

@ -0,0 +1,43 @@
package com.hzya.frame.u9c.allot.order.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.allot.order.entity.VU9cAllotOrderEntity;
import com.hzya.frame.u9c.allot.order.dao.IVU9cAllotOrderDao;
import com.hzya.frame.u9c.allot.order.service.IVU9cAllotOrderService;
import com.hzya.frame.u9c.constant.U9Constant;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* (VU9cAllotOrder)表服务实现类
*
* @author xiang2lin
* @since 2023-11-02 10:52:23
*/
@Service("vU9cAllotOrderService")
public class VU9cAllotOrderServiceImpl extends BaseService<VU9cAllotOrderEntity, String> implements IVU9cAllotOrderService {
private IVU9cAllotOrderDao vU9cAllotOrderDao;
@Autowired
public void setVU9cAllotOrderDao(IVU9cAllotOrderDao dao) {
this.vU9cAllotOrderDao = dao;
this.dao = dao;
}
/**
* 查询收货单推送睿本云专用
* @param entity
* @return
*/
@DS(U9Constant.DATA_SOURCE_CODE)
@Override
public List<VU9cAllotOrderEntity> query2Reabam(VU9cAllotOrderEntity entity) {
List<VU9cAllotOrderEntity> list = vU9cAllotOrderDao.queryList(entity, "VU9cAllotOrderEntity_list_base_reabam");
return list;
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u9c.bom.details.dao;
import com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (v_hzya_bom_details: table)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-01 15:24:40
*/
public interface IVHzyaBomDetailsDao extends IBaseDao<VHzyaBomDetailsEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.u9c.bom.details.dao.impl;
import com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity;
import com.hzya.frame.u9c.bom.details.dao.IVHzyaBomDetailsDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (VHzyaBomDetails)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-01 15:24:42
*/
@Repository("VHzyaBomDetailsDaoImpl")
public class VHzyaBomDetailsDaoImpl extends MybatisGenericDao<VHzyaBomDetailsEntity, String> implements IVHzyaBomDetailsDao{
}

View File

@ -0,0 +1,159 @@
package com.hzya.frame.u9c.bom.details.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VHzyaBomDetails)实体类
*
* @author xiang2lin
* @since 2023-11-01 15:24:43
*/
public class VHzyaBomDetailsEntity extends BaseEntity {
private String id;
private String name;
private String code;
private String skuCode;
private String parentId;
private String replaceId;
private String itemNumber;
private String subitem;
private String modifyTime;
private String usageType;
private String dosage;
private String parentNumber;
private String rounding;
private String effectiveOrNot;
private String effectiveDate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getSkuCode() {
return skuCode;
}
public void setSkuCode(String skuCode) {
this.skuCode = skuCode;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getReplaceId() {
return replaceId;
}
public void setReplaceId(String replaceId) {
this.replaceId = replaceId;
}
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public String getSubitem() {
return subitem;
}
public void setSubitem(String subitem) {
this.subitem = subitem;
}
public String getModifyTime() {
return modifyTime;
}
public void setModifyTime(String modifyTime) {
this.modifyTime = modifyTime;
}
public String getUsageType() {
return usageType;
}
public void setUsageType(String usageType) {
this.usageType = usageType;
}
public String getDosage() {
return dosage;
}
public void setDosage(String dosage) {
this.dosage = dosage;
}
public String getParentNumber() {
return parentNumber;
}
public void setParentNumber(String parentNumber) {
this.parentNumber = parentNumber;
}
public String getRounding() {
return rounding;
}
public void setRounding(String rounding) {
this.rounding = rounding;
}
public String getEffectiveOrNot() {
return effectiveOrNot;
}
public void setEffectiveOrNot(String effectiveOrNot) {
this.effectiveOrNot = effectiveOrNot;
}
public String getEffectiveDate() {
return effectiveDate;
}
public void setEffectiveDate(String effectiveDate) {
this.effectiveDate = effectiveDate;
}
}

View File

@ -0,0 +1,142 @@
<?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.u9c.bom.details.dao.impl.VHzyaBomDetailsDaoImpl">
<resultMap id="get-VHzyaBomDetailsEntity-result" type="com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity" >
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
<result property="replaceId" column="replace_id" jdbcType="VARCHAR"/>
<result property="itemNumber" column="item_number" jdbcType="VARCHAR"/>
<result property="subitem" column="subitem" jdbcType="VARCHAR"/>
<result property="modifyTime" column="modify_time" jdbcType="VARCHAR"/>
<result property="usageType" column="usage_type" jdbcType="VARCHAR"/>
<result property="dosage" column="dosage" jdbcType="VARCHAR"/>
<result property="parentNumber" column="parent_number" jdbcType="VARCHAR"/>
<result property="rounding" column="rounding" jdbcType="VARCHAR"/>
<result property="effectiveOrNot" column="effective_or_not" jdbcType="VARCHAR"/>
<result property="effectiveDate" column="effective_date" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VHzyaBomDetailsEntity_Base_Column_List">
id
,name
,code
,sku_code
,parent_id
,replace_id
,item_number
,subitem
,modify_time
,usage_type
,dosage
,parent_number
,rounding
,effective_or_not
,effective_date
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-VHzyaBomDetailsEntity-result" parameterType = "com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity">
select
<include refid="VHzyaBomDetailsEntity_Base_Column_List" />
from v_hzya_bom_details
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
<if test="replaceId != null and replaceId != ''"> and replace_id = #{replaceId} </if>
<if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber} </if>
<if test="subitem != null and subitem != ''"> and subitem = #{subitem} </if>
<if test="modifyTime != null and modifyTime != ''"> and modify_time = #{modifyTime} </if>
<if test="usageType != null and usageType != ''"> and usage_type = #{usageType} </if>
<if test="dosage != null and dosage != ''"> and dosage = #{dosage} </if>
<if test="parentNumber != null and parentNumber != ''"> and parent_number = #{parentNumber} </if>
<if test="rounding != null and rounding != ''"> and rounding = #{rounding} </if>
<if test="effectiveOrNot != null and effectiveOrNot != ''"> and effective_or_not = #{effectiveOrNot} </if>
<if test="effectiveDate != null and effectiveDate != ''"> and effective_date = #{effectiveDate} </if>
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity">
select count(1) from v_hzya_bom_details
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
<if test="replaceId != null and replaceId != ''"> and replace_id = #{replaceId} </if>
<if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber} </if>
<if test="subitem != null and subitem != ''"> and subitem = #{subitem} </if>
<if test="modifyTime != null and modifyTime != ''"> and modify_time = #{modifyTime} </if>
<if test="usageType != null and usageType != ''"> and usage_type = #{usageType} </if>
<if test="dosage != null and dosage != ''"> and dosage = #{dosage} </if>
<if test="parentNumber != null and parentNumber != ''"> and parent_number = #{parentNumber} </if>
<if test="rounding != null and rounding != ''"> and rounding = #{rounding} </if>
<if test="effectiveOrNot != null and effectiveOrNot != ''"> and effective_or_not = #{effectiveOrNot} </if>
<if test="effectiveDate != null and effectiveDate != ''"> and effective_date = #{effectiveDate} </if>
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VHzyaBomDetailsEntity-result" parameterType = "com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity">
select
<include refid="VHzyaBomDetailsEntity_Base_Column_List" />
from v_hzya_bom_details
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id like concat('%',#{id},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="skuCode != null and skuCode != ''"> and sku_code like concat('%',#{skuCode},'%') </if>
<if test="parentId != null and parentId != ''"> and parent_id like concat('%',#{parentId},'%') </if>
<if test="replaceId != null and replaceId != ''"> and replace_id like concat('%',#{replaceId},'%') </if>
<if test="itemNumber != null and itemNumber != ''"> and item_number like concat('%',#{itemNumber},'%') </if>
<if test="subitem != null and subitem != ''"> and subitem like concat('%',#{subitem},'%') </if>
<if test="modifyTime != null and modifyTime != ''"> and modify_time like concat('%',#{modifyTime},'%') </if>
<if test="usageType != null and usageType != ''"> and usage_type like concat('%',#{usageType},'%') </if>
<if test="dosage != null and dosage != ''"> and dosage like concat('%',#{dosage},'%') </if>
<if test="parentNumber != null and parentNumber != ''"> and parent_number like concat('%',#{parentNumber},'%') </if>
<if test="rounding != null and rounding != ''"> and rounding like concat('%',#{rounding},'%') </if>
<if test="effectiveOrNot != null and effectiveOrNot != ''"> and effective_or_not like concat('%',#{effectiveOrNot},'%') </if>
<if test="effectiveDate != null and effectiveDate != ''"> and effective_date like concat('%',#{effectiveDate},'%') </if>
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="VHzyaBomDetailsentity_list_or" resultMap="get-VHzyaBomDetailsEntity-result" parameterType = "com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity">
select
<include refid="VHzyaBomDetailsEntity_Base_Column_List" />
from v_hzya_bom_details
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> or id = #{id} </if>
<if test="name != null and name != ''"> or name = #{name} </if>
<if test="code != null and code != ''"> or code = #{code} </if>
<if test="skuCode != null and skuCode != ''"> or sku_code = #{skuCode} </if>
<if test="parentId != null and parentId != ''"> or parent_id = #{parentId} </if>
<if test="replaceId != null and replaceId != ''"> or replace_id = #{replaceId} </if>
<if test="itemNumber != null and itemNumber != ''"> or item_number = #{itemNumber} </if>
<if test="subitem != null and subitem != ''"> or subitem = #{subitem} </if>
<if test="modifyTime != null and modifyTime != ''"> or modify_time = #{modifyTime} </if>
<if test="usageType != null and usageType != ''"> or usage_type = #{usageType} </if>
<if test="dosage != null and dosage != ''"> or dosage = #{dosage} </if>
<if test="parentNumber != null and parentNumber != ''"> or parent_number = #{parentNumber} </if>
<if test="rounding != null and rounding != ''"> or rounding = #{rounding} </if>
<if test="effectiveOrNot != null and effectiveOrNot != ''"> or effective_or_not = #{effectiveOrNot} </if>
<if test="effectiveDate != null and effectiveDate != ''"> or effective_date = #{effectiveDate} </if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u9c.bom.details.service;
import com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (VHzyaBomDetails)表服务接口
*
* @author xiang2lin
* @since 2023-11-01 15:24:44
*/
public interface IVHzyaBomDetailsService extends IBaseService<VHzyaBomDetailsEntity, String>{
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.u9c.bom.details.service.impl;
import com.hzya.frame.u9c.bom.details.entity.VHzyaBomDetailsEntity;
import com.hzya.frame.u9c.bom.details.dao.IVHzyaBomDetailsDao;
import com.hzya.frame.u9c.bom.details.service.IVHzyaBomDetailsService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* (VHzyaBomDetails)表服务实现类
*
* @author xiang2lin
* @since 2023-11-01 15:24:45
*/
@Service("vHzyaBomDetailsService")
public class VHzyaBomDetailsServiceImpl extends BaseService<VHzyaBomDetailsEntity, String> implements IVHzyaBomDetailsService {
private IVHzyaBomDetailsDao vHzyaBomDetailsDao;
@Autowired
public void setVHzyaBomDetailsDao(IVHzyaBomDetailsDao dao) {
this.vHzyaBomDetailsDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u9c.bom.main.dao;
import com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (v_hzya_bom_main: table)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-01 15:23:51
*/
public interface IVHzyaBomMainDao extends IBaseDao<VHzyaBomMainEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.u9c.bom.main.dao.impl;
import com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity;
import com.hzya.frame.u9c.bom.main.dao.IVHzyaBomMainDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (VHzyaBomMain)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-01 15:23:56
*/
@Repository("VHzyaBomMainDaoImpl")
public class VHzyaBomMainDaoImpl extends MybatisGenericDao<VHzyaBomMainEntity, String> implements IVHzyaBomMainDao{
}

View File

@ -0,0 +1,136 @@
package com.hzya.frame.u9c.bom.main.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VHzyaBomMain)实体类
*
* @author xiang2lin
* @since 2023-11-01 15:23:58
*/
public class VHzyaBomMainEntity extends BaseEntity {
private String def1;//是否推送门店 True才推送
private String id;
private String skuCode;
private String name;
private String code;
private String versionCode;
private String classify;
private String productionPurpose;
private String batch;
private String mainBatch;
private String effectiveDate;
private String loseEfficacyDate;
private String modifyTime;
public String getSkuCode() {
return skuCode;
}
public void setSkuCode(String skuCode) {
this.skuCode = skuCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getVersionCode() {
return versionCode;
}
public void setVersionCode(String versionCode) {
this.versionCode = versionCode;
}
public String getClassify() {
return classify;
}
public void setClassify(String classify) {
this.classify = classify;
}
public String getProductionPurpose() {
return productionPurpose;
}
public void setProductionPurpose(String productionPurpose) {
this.productionPurpose = productionPurpose;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public String getMainBatch() {
return mainBatch;
}
public void setMainBatch(String mainBatch) {
this.mainBatch = mainBatch;
}
public String getEffectiveDate() {
return effectiveDate;
}
public void setEffectiveDate(String effectiveDate) {
this.effectiveDate = effectiveDate;
}
public String getLoseEfficacyDate() {
return loseEfficacyDate;
}
public void setLoseEfficacyDate(String loseEfficacyDate) {
this.loseEfficacyDate = loseEfficacyDate;
}
public String getModifyTime() {
return modifyTime;
}
public void setModifyTime(String modifyTime) {
this.modifyTime = modifyTime;
}
public String getDef1() {
return def1;
}
public void setDef1(String def1) {
this.def1 = def1;
}
}

View File

@ -0,0 +1,151 @@
<?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.u9c.bom.main.dao.impl.VHzyaBomMainDaoImpl">
<resultMap id="get-VHzyaBomMainEntity-result" type="com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity" >
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
<result property="def1" column="def1" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="versionCode" column="version_code" jdbcType="VARCHAR"/>
<result property="classify" column="classify" jdbcType="VARCHAR"/>
<result property="productionPurpose" column="production_purpose" jdbcType="VARCHAR"/>
<result property="batch" column="batch" jdbcType="VARCHAR"/>
<result property="mainBatch" column="main_batch" jdbcType="VARCHAR"/>
<result property="effectiveDate" column="effective_date" jdbcType="VARCHAR"/>
<result property="loseEfficacyDate" column="lose_efficacy_date" jdbcType="VARCHAR"/>
<result property="modifyTime" column="modify_time" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VHzyaBomMainEntity_Base_Column_List">
id
,sku_code
,def1
,name
,code
,version_code
,classify
,production_purpose
,batch
,main_batch
,effective_date
,lose_efficacy_date
,modify_time
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-VHzyaBomMainEntity-result" parameterType = "com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity">
select
<include refid="VHzyaBomMainEntity_Base_Column_List" />
from v_hzya_bom_main
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="versionCode != null and versionCode != ''"> and version_code = #{versionCode} </if>
<if test="classify != null and classify != ''"> and classify = #{classify} </if>
<if test="productionPurpose != null and productionPurpose != ''"> and production_purpose = #{productionPurpose} </if>
<if test="batch != null and batch != ''"> and batch = #{batch} </if>
<if test="mainBatch != null and mainBatch != ''"> and main_batch = #{mainBatch} </if>
<if test="effectiveDate != null and effectiveDate != ''"> and effective_date = #{effectiveDate} </if>
<if test="loseEfficacyDate != null and loseEfficacyDate != ''"> and lose_efficacy_date = #{loseEfficacyDate} </if>
<if test="modifyTime != null and modifyTime != ''"> and modify_time = #{modifyTime} </if>
and sts='Y'
</trim>
<if test=" sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 睿本云接口专用 相二林 -->
<select id="VHzyaBomMainEntity_entity_list_base_reabam" resultMap="get-VHzyaBomMainEntity-result" parameterType = "com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity">
select
<include refid="VHzyaBomMainEntity_Base_Column_List" />
from v_hzya_bom_main
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="versionCode != null and versionCode != ''"> and version_code = #{versionCode} </if>
<if test="classify != null and classify != ''"> and classify = #{classify} </if>
<if test="productionPurpose != null and productionPurpose != ''"> and production_purpose = #{productionPurpose} </if>
<if test="batch != null and batch != ''"> and batch = #{batch} </if>
<if test="mainBatch != null and mainBatch != ''"> and main_batch = #{mainBatch} </if>
<if test="effectiveDate != null and effectiveDate != ''"> and effective_date = #{effectiveDate} </if>
<if test="loseEfficacyDate != null and loseEfficacyDate != ''"> and lose_efficacy_date = #{loseEfficacyDate} </if>
<if test="modifyTime != null and modifyTime != ''"> and modify_time >= #{modifyTime} </if>
and def1 = 'True'
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity">
select count(1) from v_hzya_bom_main
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id = #{id} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
<if test="versionCode != null and versionCode != ''"> and version_code = #{versionCode} </if>
<if test="classify != null and classify != ''"> and classify = #{classify} </if>
<if test="productionPurpose != null and productionPurpose != ''"> and production_purpose = #{productionPurpose} </if>
<if test="batch != null and batch != ''"> and batch = #{batch} </if>
<if test="mainBatch != null and mainBatch != ''"> and main_batch = #{mainBatch} </if>
<if test="effectiveDate != null and effectiveDate != ''"> and effective_date = #{effectiveDate} </if>
<if test="loseEfficacyDate != null and loseEfficacyDate != ''"> and lose_efficacy_date = #{loseEfficacyDate} </if>
<if test="modifyTime != null and modifyTime != ''"> and modify_time = #{modifyTime} </if>
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VHzyaBomMainEntity-result" parameterType = "com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity">
select
<include refid="VHzyaBomMainEntity_Base_Column_List" />
from v_hzya_bom_main
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> and id like concat('%',#{id},'%') </if>
<if test="skuCode != null and skuCode != ''"> and sku_code like concat('%',#{skuCode},'%') </if>
<if test="name != null and name != ''"> and name like concat('%',#{name},'%') </if>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
<if test="versionCode != null and versionCode != ''"> and version_code like concat('%',#{versionCode},'%') </if>
<if test="classify != null and classify != ''"> and classify like concat('%',#{classify},'%') </if>
<if test="productionPurpose != null and productionPurpose != ''"> and production_purpose like concat('%',#{productionPurpose},'%') </if>
<if test="batch != null and batch != ''"> and batch like concat('%',#{batch},'%') </if>
<if test="mainBatch != null and mainBatch != ''"> and main_batch like concat('%',#{mainBatch},'%') </if>
<if test="effectiveDate != null and effectiveDate != ''"> and effective_date like concat('%',#{effectiveDate},'%') </if>
<if test="loseEfficacyDate != null and loseEfficacyDate != ''"> and lose_efficacy_date like concat('%',#{loseEfficacyDate},'%') </if>
<if test="modifyTime != null and modifyTime != ''"> and modify_time like concat('%',#{modifyTime},'%') </if>
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="VHzyaBomMainentity_list_or" resultMap="get-VHzyaBomMainEntity-result" parameterType = "com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity">
select
<include refid="VHzyaBomMainEntity_Base_Column_List" />
from v_hzya_bom_main
<trim prefix="where" prefixOverrides="and">
<if test="id != null"> or id = #{id} </if>
<if test="skuCode != null and skuCode != ''"> or sku_code = #{skuCode} </if>
<if test="name != null and name != ''"> or name = #{name} </if>
<if test="code != null and code != ''"> or code = #{code} </if>
<if test="versionCode != null and versionCode != ''"> or version_code = #{versionCode} </if>
<if test="classify != null and classify != ''"> or classify = #{classify} </if>
<if test="productionPurpose != null and productionPurpose != ''"> or production_purpose = #{productionPurpose} </if>
<if test="batch != null and batch != ''"> or batch = #{batch} </if>
<if test="mainBatch != null and mainBatch != ''"> or main_batch = #{mainBatch} </if>
<if test="effectiveDate != null and effectiveDate != ''"> or effective_date = #{effectiveDate} </if>
<if test="loseEfficacyDate != null and loseEfficacyDate != ''"> or lose_efficacy_date = #{loseEfficacyDate} </if>
<if test="modifyTime != null and modifyTime != ''"> or modify_time = #{modifyTime} </if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,23 @@
package com.hzya.frame.u9c.bom.main.service;
import com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
/**
* (VHzyaBomMain)物料清单BOM
*
* @author xiang2lin
* @since 2023-11-01 15:23:59
*/
public interface IVHzyaBomMainService extends IBaseService<VHzyaBomMainEntity, String>{
/**
* 查询BOM接口同步睿本云用
* @param entity
* @return
* @throws Exception
*/
List<VHzyaBomMainEntity> query2Reabam(VHzyaBomMainEntity entity)throws Exception;
}

View File

@ -0,0 +1,38 @@
package com.hzya.frame.u9c.bom.main.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.bom.main.entity.VHzyaBomMainEntity;
import com.hzya.frame.u9c.bom.main.dao.IVHzyaBomMainDao;
import com.hzya.frame.u9c.bom.main.service.IVHzyaBomMainService;
import com.hzya.frame.u9c.constant.U9Constant;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* (VHzyaBomMain)表服务实现类
*
* @author xiang2lin
* @since 2023-11-01 15:24:00
*/
@Service("vHzyaBomMainService")
public class VHzyaBomMainServiceImpl extends BaseService<VHzyaBomMainEntity, String> implements IVHzyaBomMainService {
private IVHzyaBomMainDao vHzyaBomMainDao;
@Autowired
public void setVHzyaBomMainDao(IVHzyaBomMainDao dao) {
this.vHzyaBomMainDao = dao;
this.dao = dao;
}
@DS(U9Constant.DATA_SOURCE_CODE)
@Override
public List<VHzyaBomMainEntity> query2Reabam(VHzyaBomMainEntity entity) throws Exception {
List<VHzyaBomMainEntity> list = vHzyaBomMainDao.queryList(entity,"VHzyaBomMainEntity_entity_list_base_reabam");
return list;
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u9c.bom.replace.dao;
import com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (v_hzya_bom_replace: table)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-20 09:41:20
*/
public interface IVHzyaBomReplaceDao extends IBaseDao<VHzyaBomReplaceEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.u9c.bom.replace.dao.impl;
import com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity;
import com.hzya.frame.u9c.bom.replace.dao.IVHzyaBomReplaceDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (VHzyaBomReplace)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-20 09:41:22
*/
@Repository("VHzyaBomReplaceDaoImpl")
public class VHzyaBomReplaceDaoImpl extends MybatisGenericDao<VHzyaBomReplaceEntity, String> implements IVHzyaBomReplaceDao{
}

View File

@ -0,0 +1,65 @@
package com.hzya.frame.u9c.bom.replace.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VHzyaBomReplace)实体类
*
* @author xiang2lin
* @since 2023-11-20 09:41:22
*/
public class VHzyaBomReplaceEntity extends BaseEntity {
private String detailId;
private String bomId;
private String itemNumber;
private String skuCode;
private String code;
public String getDetailId() {
return detailId;
}
public void setDetailId(String detailId) {
this.detailId = detailId;
}
public String getBomId() {
return bomId;
}
public void setBomId(String bomId) {
this.bomId = bomId;
}
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public String getSkuCode() {
return skuCode;
}
public void setSkuCode(String skuCode) {
this.skuCode = skuCode;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}

View File

@ -0,0 +1,84 @@
<?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.u9c.bom.replace.dao.impl.VHzyaBomReplaceDaoImpl">
<resultMap id="get-VHzyaBomReplaceEntity-result" type="com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity" >
<result property="detailId" column="detail_id" jdbcType="VARCHAR"/>
<result property="bomId" column="bom_id" jdbcType="VARCHAR"/>
<result property="itemNumber" column="item_number" jdbcType="VARCHAR"/>
<result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VHzyaBomReplaceEntity_Base_Column_List">
detail_id
,bom_id
,item_number
,sku_code
,code
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-VHzyaBomReplaceEntity-result" parameterType = "com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity">
select
<include refid="VHzyaBomReplaceEntity_Base_Column_List" />
from v_hzya_bom_replace
<trim prefix="where" prefixOverrides="and">
<if test="detailId != null and detailId != ''"> and detail_id = #{detailId} </if>
<if test="bomId != null and bomId != ''"> and bom_id = #{bomId} </if>
<if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity">
select count(1) from v_hzya_bom_replace
<trim prefix="where" prefixOverrides="and">
<if test="detailId != null and detailId != ''"> and detail_id = #{detailId} </if>
<if test="bomId != null and bomId != ''"> and bom_id = #{bomId} </if>
<if test="itemNumber != null and itemNumber != ''"> and item_number = #{itemNumber} </if>
<if test="skuCode != null and skuCode != ''"> and sku_code = #{skuCode} </if>
<if test="code != null and code != ''"> and code = #{code} </if>
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VHzyaBomReplaceEntity-result" parameterType = "com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity">
select
<include refid="VHzyaBomReplaceEntity_Base_Column_List" />
from v_hzya_bom_replace
<trim prefix="where" prefixOverrides="and">
<if test="detailId != null and detailId != ''"> and detail_id like concat('%',#{detailId},'%') </if>
<if test="bomId != null and bomId != ''"> and bom_id like concat('%',#{bomId},'%') </if>
<if test="itemNumber != null and itemNumber != ''"> and item_number like concat('%',#{itemNumber},'%') </if>
<if test="skuCode != null and skuCode != ''"> and sku_code like concat('%',#{skuCode},'%') </if>
<if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
and sts='Y'
</trim>
<if test=" sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="VHzyaBomReplaceentity_list_or" resultMap="get-VHzyaBomReplaceEntity-result" parameterType = "com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity">
select
<include refid="VHzyaBomReplaceEntity_Base_Column_List" />
from v_hzya_bom_replace
<trim prefix="where" prefixOverrides="and">
<if test="detailId != null and detailId != ''"> or detail_id = #{detailId} </if>
<if test="bomId != null and bomId != ''"> or bom_id = #{bomId} </if>
<if test="itemNumber != null and itemNumber != ''"> or item_number = #{itemNumber} </if>
<if test="skuCode != null and skuCode != ''"> or sku_code = #{skuCode} </if>
<if test="code != null and code != ''"> or code = #{code} </if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u9c.bom.replace.service;
import com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (VHzyaBomReplace)表服务接口
*
* @author xiang2lin
* @since 2023-11-20 09:41:23
*/
public interface IVHzyaBomReplaceService extends IBaseService<VHzyaBomReplaceEntity, String>{
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.u9c.bom.replace.service.impl;
import com.hzya.frame.u9c.bom.replace.entity.VHzyaBomReplaceEntity;
import com.hzya.frame.u9c.bom.replace.dao.IVHzyaBomReplaceDao;
import com.hzya.frame.u9c.bom.replace.service.IVHzyaBomReplaceService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* (VHzyaBomReplace)表服务实现类
*
* @author xiang2lin
* @since 2023-11-20 09:41:24
*/
@Service("vHzyaBomReplaceService")
public class VHzyaBomReplaceServiceImpl extends BaseService<VHzyaBomReplaceEntity, String> implements IVHzyaBomReplaceService {
private IVHzyaBomReplaceDao vHzyaBomReplaceDao;
@Autowired
public void setVHzyaBomReplaceDao(IVHzyaBomReplaceDao dao) {
this.vHzyaBomReplaceDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,36 @@
package com.hzya.frame.u9c.category.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.category.entity.VU9cCategoryEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity;
import java.util.List;
/**
* (view:v_u9c_category)表数据库访问层
*
* @author makejava
* @since 2023-10-26 09:22:18
*/
public interface IVU9cCategoryDao extends IBaseDao<VU9cCategoryEntity, String> {
/***
* @Content:
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日09:26:58
* @Param
* @return
**/
@DS("henghua_sqlserver_test")
List<VU9cCategoryEntity> getu9cCategory(VU9cCategoryEntity category);
/***
* @Content:更新存货分类信息
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日09:29:50
* @Param
* @return
**/
@DS("henghua_sqlserver_test")
int updateCategory(VU9cCategoryEntity itemmaster);
}

View File

@ -0,0 +1,30 @@
package com.hzya.frame.u9c.category.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.category.entity.VU9cCategoryEntity;
import com.hzya.frame.u9c.category.dao.IVU9cCategoryDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (VU9cCategory)表数据库访问层
*
* @author makejava
* @since 2023-10-26 09:22:25
*/
@Repository("VU9cCategoryDaoImpl")
public class VU9cCategoryDaoImpl extends MybatisGenericDao<VU9cCategoryEntity, String> implements IVU9cCategoryDao{
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cCategoryEntity> getu9cCategory(VU9cCategoryEntity category) {
return (List<VU9cCategoryEntity>) super.selectList("com.hzya.frame.u9c.category.dao.impl.VU9cCategoryDaoImpl.entity_list_base_category",category);
}
@DS("henghua_sqlserver_test_xel")
@Override
public int updateCategory(VU9cCategoryEntity itemmaster) {
return super.update("com.hzya.frame.u9c.category.dao.impl.VU9cCategoryDaoImpl.entity_update_category",itemmaster);
}
}

View File

@ -0,0 +1,109 @@
package com.hzya.frame.u9c.category.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cCategory)实体类
*
* @author makejava
* @since 2023-10-26 09:22:27
*/
public class VU9cCategoryEntity extends BaseEntity {
private String id;
private String code;
private String name;
private String dataId;
private String crmId;
private String operatorsId;
private String crmUpId;
private String upCode;
private String upName;
private String updateTime;
public String getCrmId() {
return crmId;
}
public void setCrmId(String crmId) {
this.crmId = crmId;
}
public String getOperatorsId() {
return operatorsId;
}
public void setOperatorsId(String operatorsId) {
this.operatorsId = operatorsId;
}
public String getCrmUpId() {
return crmUpId;
}
public void setCrmUpId(String crmUpId) {
this.crmUpId = crmUpId;
}
public String getUpCode() {
return upCode;
}
public void setUpCode(String upCode) {
this.upCode = upCode;
}
public String getUpName() {
return upName;
}
public void setUpName(String upName) {
this.upName = upName;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,35 @@
<?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.u9c.category.dao.impl.VU9cCategoryDaoImpl">
<resultMap id="get-VU9cCategoryEntity-result" type="com.hzya.frame.u9c.category.entity.VU9cCategoryEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="crmId" column="crm_id" jdbcType="VARCHAR"/>
<result property="operatorsId" column="operators_id" jdbcType="VARCHAR"/>
<result property="crmUpId" column="crm_up_id" jdbcType="VARCHAR"/>
<result property="upCode" column="up_code" jdbcType="VARCHAR"/>
<result property="upName" column="up_name" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cCategoryEntity_Base_Column_List">
id
,code
,name
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base_category" resultMap="get-VU9cCategoryEntity-result" parameterType = "com.hzya.frame.u9c.category.entity.VU9cCategoryEntity">
select * from v_u9c_cbo_category
where (crm_id is null or crm_id ='' or update_time > #{updateTime})
</select>
<!--通过主键修改方法-->
<update id="entity_update_category" parameterType = "com.hzya.frame.u9c.category.entity.VU9cCategoryEntity" >
update CBO_Category set
DescFlexField_PrivateDescSeg1 = #{dataId}
where id= #{id}
</update>
</mapper>

View File

@ -0,0 +1,20 @@
package com.hzya.frame.u9c.category.service;
import com.hzya.frame.u9c.category.entity.VU9cCategoryEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (VU9cCategory)表服务接口
*
* @author makejava
* @since 2023-10-26 09:22:29
*/
public interface IVU9cCategoryService extends IBaseService<VU9cCategoryEntity, String>{
/***
* @Content:查询U9C料品分类档案
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日09:24:50
* @Param
* @return
**/
String sendU9cCategoryToCRM();
}

View File

@ -0,0 +1,101 @@
package com.hzya.frame.u9c.category.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.u9c.category.entity.VU9cCategoryEntity;
import com.hzya.frame.u9c.category.dao.IVU9cCategoryDao;
import com.hzya.frame.u9c.category.service.IVU9cCategoryService;
import com.hzya.frame.u9c.util.CrmUtil;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* (VU9cCategory)表服务实现类
*
* @author makejava
* @since 2023-10-26 09:22:30
*/
@Service("vU9cCategoryService")
public class VU9cCategoryServiceImpl extends BaseService<VU9cCategoryEntity, String> implements IVU9cCategoryService {
private IVU9cCategoryDao vU9cCategoryDao;
@Autowired
public void setVU9cCategoryDao(IVU9cCategoryDao dao) {
this.vU9cCategoryDao = dao;
this.dao = dao;
}
//上一次同步时间
private String LAST_SYNCHRONISED_TIME = "";
@Override
public String sendU9cCategoryToCRM() {
JSONObject resultObj = new JSONObject();
//获取待推送的U9c
VU9cCategoryEntity category = new VU9cCategoryEntity();
if (StrUtil.isBlank(LAST_SYNCHRONISED_TIME)) {
LAST_SYNCHRONISED_TIME = DateUtil.now();
}
//暂存时间
String temp_time = LAST_SYNCHRONISED_TIME;
category.setUpdateTime(temp_time);
List<VU9cCategoryEntity> VU9cCategoryEntityList = vU9cCategoryDao.getu9cCategory(category);
if(VU9cCategoryEntityList.size()>0){
LAST_SYNCHRONISED_TIME = DateUtil.now();
for(VU9cCategoryEntity itemmaster : VU9cCategoryEntityList){
try {
String permanentCode = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
JSONObject tokenObj = CrmUtil.getToken(permanentCode);
//拼接传递参数
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
main.put("duplicateCheck",true);
JSONObject data = new JSONObject();
//根据CRM主键判断是新增还是更新
String crmId = itemmaster.getCrmId();
if(StrUtil.isNotEmpty(crmId)){
data.put("editFlag","2");//状态 2是更新
data.put("id",crmId);//状态 2是更新-
}else{
data.put("editFlag","1");//状态1 是新增
}
String crmUpId = itemmaster.getCrmUpId();
if(StrUtil.isNotEmpty(crmUpId)){
data.put("pid",itemmaster.getCrmUpId());//上级主键
}
data.put("name",itemmaster.getName());//分类名称
data.put("category_code",itemmaster.getCode());//分类编码
data.put("orderField","1");//排序号 暂时默认1
main.put("data",data);
String apiCode = "8000090002";
resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
String errorDescription = resultObj.getString("errorDescription");
if("success".equals(errorDescription)){
if(StrUtil.isEmpty(crmId)){
String dataId = resultObj.getString("dataId");
if(StrUtil.isNotEmpty(dataId)){
itemmaster.setDataId(dataId);
int state = vU9cCategoryDao.updateCategory(itemmaster);
}
}
}
} catch (Exception e) {
itemmaster.setDataId("接口错误,请联系管理员");
vU9cCategoryDao.updateCategory(itemmaster);
e.printStackTrace();
}
}
}
return resultObj.toString();
}
}

View File

@ -0,0 +1,11 @@
package com.hzya.frame.u9c.constant;
/**
* @Description u9c常量
* @Author xiangerlin
* @Date 2023/11/20 10:17
**/
public class U9Constant {
//u9c数据库编码
public static final String DATA_SOURCE_CODE = "henghua_sqlserver_test_xel";
}

View File

@ -0,0 +1,34 @@
package com.hzya.frame.u9c.itemmaster.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (v_u9c_itemmaster: view)表数据库访问层
*
* @author xiaoguo
* @since 2023-10-25 14:30:33
*/
public interface IVU9cItemmasterDao extends IBaseDao<VU9cItemmasterEntity, String> {
/***
* @Content:查询U9C未推送的数据
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月25日14:43:00
* @Param
* @return
**/
@DS("henghua_sqlserver_test")
List<VU9cItemmasterEntity> getu9cItemMaster(VU9cItemmasterEntity entity);
/**
* 更新U9C存货状态
* @param itemmaster
* @return
*/
@DS("henghua_sqlserver_test")
int updateItemMaster(VU9cItemmasterEntity itemmaster);
}

View File

@ -0,0 +1,31 @@
package com.hzya.frame.u9c.itemmaster.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity;
import com.hzya.frame.u9c.itemmaster.dao.IVU9cItemmasterDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (VU9cItemmaster)表数据库访问层
*
* @author xiaoguo
* @since 2023-10-25 14:30:34
*/
@Repository(value = "VU9cItemmasterDaoImpl")
public class VU9cItemmasterDaoImpl extends MybatisGenericDao<VU9cItemmasterEntity, String> implements IVU9cItemmasterDao{
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cItemmasterEntity> getu9cItemMaster(VU9cItemmasterEntity entity) {
return (List<VU9cItemmasterEntity>) super.selectList("com.hzya.frame.u9c.itemmaster.dao.impl.VU9cItemmasterDaoImpl.entity_list_base_item_master",entity);
}
@DS("henghua_sqlserver_test_xel")
@Override
public int updateItemMaster(VU9cItemmasterEntity itemmaster) {
return super.update("com.hzya.frame.u9c.itemmaster.dao.impl.VU9cItemmasterDaoImpl.entity_update_item_master",itemmaster);
}
}

View File

@ -0,0 +1,603 @@
package com.hzya.frame.u9c.itemmaster.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cItemmaster)实体类
*
* @author xiaoguo
* @since 2023-10-30 16:10:13
*/
public class VU9cItemmasterEntity extends BaseEntity {
private String costType;//睿本云成本评估方法
/** 物料编码*/
private String code;
//有效天数
private String LotValidDate;
/** 物料名称 */
private String name;
/** 分类ID*/
private String categoryId;
/** 分类编码*/
private String classificationCode;
/** 分类名称 */
private String classificationName;
/** CRM类别ID*/
private String crmCategoryId;
/** crmId*/
private String crmId;
/** 操作员ID*/
private String operatorsId;
/** 单位代码*/
private String unitCode;
/** */
private String dataId;
/** 单位名称*/
private String unitName;
/** 规格*/
private String specs;
/** suk码*/
private String sukCode;
/** 参考号2*/
private String referenceCode;
/** 料品形态属性*/
private String materialForm;
/** 可库存交易*/
private String inventoryTransactions;
/** 可采购 */
private String procure;
/** 可销售 */
private String sale;
/** 可生产*/
private String produce;
/** 可MRP*/
private String mrp;
/** 可BOM*/
private String bom;
/** 双单位 */
private String doubleUnit;
/** 多单位*/
private String multiUnit;
/** 固定转换率 */
private String conversionRate;
/** 可预留 */
private String reserved;
/** 批号参数 */
private String batchNumber;
/** 取价来源*/
private String pricingSource;
/** 收货程序*/
private String receivingProcedure;
/** 库存主单位*/
private String inventoryMasterUnit;
private String inventoryMasterUnitCode;//库存主单位编码
private String inventoryMasterUnitZhl;//库存主单位转换率
/** 库存单位*/
private String inventoryUnit;
private String inventoryUnitCode;//库存单位编码
private String inventoryUnitZhl;//库存单位转换率
/** 采购单位*/
private String purchasingUnit;
private String purchasingUnitCode;//采购单位编码
private String inventoryPurchasingUnitZhl;//采购单位转换率
/** 销售单位*/
private String saleUnit;
private String saleUnitCode;//销售单位编码
private String inventorySaleUnitZhl;//销售单位转换率
/** 生产单位*/
private String productionUnit;
/** 领料单位*/
private String materialRequisitionUnit;
/** 计价单位*/
private String pricingUnit;
/** 重量单位*/
private String weightUnit;
/** 体积单位 */
private String volumeUnit;
/** 成本单位*/
private String costUnit;
private String sale_price;//销售价
private String cost_price;//成本价
private String cost_price_spr;//销售价目表的单价这个传到睿本云成本价
private String has_sale_item;//是否销售物料
private String has_weigh_item;//是否称重物料
private String proType;//产品大类
private String standardPrice;//标准价格
private String orgName;//所属公司
private String nameOrg;//
private String crmCostPrice;//crm成本价
private String CRMSalesRate;//CRM销售换算率
private String Effective_IsEffective;//U9料品状态 0停用 1启用
public String getEffective_IsEffective() {
return Effective_IsEffective;
}
public void setEffective_IsEffective(String effective_IsEffective) {
Effective_IsEffective = effective_IsEffective;
}
public String getCRMSalesRate() {
return CRMSalesRate;
}
public void setCRMSalesRate(String CRMSalesRate) {
this.CRMSalesRate = CRMSalesRate;
}
public String getCrmCostPrice() {
return crmCostPrice;
}
public void setCrmCostPrice(String crmCostPrice) {
this.crmCostPrice = crmCostPrice;
}
public String getNameOrg() {
return nameOrg;
}
public void setNameOrg(String nameOrg) {
this.nameOrg = nameOrg;
}
public String getOrgName() {
return orgName;
}
public void setOrgName(String orgName) {
this.orgName = orgName;
}
public String getStandardPrice() {
return standardPrice;
}
public void setStandardPrice(String standardPrice) {
this.standardPrice = standardPrice;
}
public String getProType() {
return proType;
}
public void setProType(String proType) {
this.proType = proType;
}
public String getLotValidDate() {
return LotValidDate;
}
public void setLotValidDate(String lotValidDate) {
LotValidDate = lotValidDate;
}
/** 修改时间*/
private String updatetime;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId;
}
public String getClassificationCode() {
return classificationCode;
}
public void setClassificationCode(String classificationCode) {
this.classificationCode = classificationCode;
}
public String getClassificationName() {
return classificationName;
}
public void setClassificationName(String classificationName) {
this.classificationName = classificationName;
}
public String getCrmCategoryId() {
return crmCategoryId;
}
public void setCrmCategoryId(String crmCategoryId) {
this.crmCategoryId = crmCategoryId;
}
public String getCrmId() {
return crmId;
}
public void setCrmId(String crmId) {
this.crmId = crmId;
}
public String getOperatorsId() {
return operatorsId;
}
public void setOperatorsId(String operatorsId) {
this.operatorsId = operatorsId;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public String getSpecs() {
return specs;
}
public void setSpecs(String specs) {
this.specs = specs;
}
public String getSukCode() {
return sukCode;
}
public void setSukCode(String sukCode) {
this.sukCode = sukCode;
}
public String getReferenceCode() {
return referenceCode;
}
public void setReferenceCode(String referenceCode) {
this.referenceCode = referenceCode;
}
public String getMaterialForm() {
return materialForm;
}
public void setMaterialForm(String materialForm) {
this.materialForm = materialForm;
}
public String getInventoryTransactions() {
return inventoryTransactions;
}
public void setInventoryTransactions(String inventoryTransactions) {
this.inventoryTransactions = inventoryTransactions;
}
public String getProcure() {
return procure;
}
public void setProcure(String procure) {
this.procure = procure;
}
public String getSale() {
return sale;
}
public void setSale(String sale) {
this.sale = sale;
}
public String getProduce() {
return produce;
}
public void setProduce(String produce) {
this.produce = produce;
}
public String getMrp() {
return mrp;
}
public void setMrp(String mrp) {
this.mrp = mrp;
}
public String getBom() {
return bom;
}
public void setBom(String bom) {
this.bom = bom;
}
public String getDoubleUnit() {
return doubleUnit;
}
public void setDoubleUnit(String doubleUnit) {
this.doubleUnit = doubleUnit;
}
public String getMultiUnit() {
return multiUnit;
}
public void setMultiUnit(String multiUnit) {
this.multiUnit = multiUnit;
}
public String getConversionRate() {
return conversionRate;
}
public void setConversionRate(String conversionRate) {
this.conversionRate = conversionRate;
}
public String getReserved() {
return reserved;
}
public void setReserved(String reserved) {
this.reserved = reserved;
}
public String getBatchNumber() {
return batchNumber;
}
public void setBatchNumber(String batchNumber) {
this.batchNumber = batchNumber;
}
public String getPricingSource() {
return pricingSource;
}
public void setPricingSource(String pricingSource) {
this.pricingSource = pricingSource;
}
public String getReceivingProcedure() {
return receivingProcedure;
}
public void setReceivingProcedure(String receivingProcedure) {
this.receivingProcedure = receivingProcedure;
}
public String getInventoryMasterUnit() {
return inventoryMasterUnit;
}
public void setInventoryMasterUnit(String inventoryMasterUnit) {
this.inventoryMasterUnit = inventoryMasterUnit;
}
public String getInventoryUnit() {
return inventoryUnit;
}
public void setInventoryUnit(String inventoryUnit) {
this.inventoryUnit = inventoryUnit;
}
public String getPurchasingUnit() {
return purchasingUnit;
}
public void setPurchasingUnit(String purchasingUnit) {
this.purchasingUnit = purchasingUnit;
}
public String getSaleUnit() {
return saleUnit;
}
public void setSaleUnit(String saleUnit) {
this.saleUnit = saleUnit;
}
public String getProductionUnit() {
return productionUnit;
}
public void setProductionUnit(String productionUnit) {
this.productionUnit = productionUnit;
}
public String getMaterialRequisitionUnit() {
return materialRequisitionUnit;
}
public void setMaterialRequisitionUnit(String materialRequisitionUnit) {
this.materialRequisitionUnit = materialRequisitionUnit;
}
public String getPricingUnit() {
return pricingUnit;
}
public void setPricingUnit(String pricingUnit) {
this.pricingUnit = pricingUnit;
}
public String getWeightUnit() {
return weightUnit;
}
public void setWeightUnit(String weightUnit) {
this.weightUnit = weightUnit;
}
public String getVolumeUnit() {
return volumeUnit;
}
public void setVolumeUnit(String volumeUnit) {
this.volumeUnit = volumeUnit;
}
public String getCostUnit() {
return costUnit;
}
public void setCostUnit(String costUnit) {
this.costUnit = costUnit;
}
public String getUpdatetime() {
return updatetime;
}
public void setUpdatetime(String updatetime) {
this.updatetime = updatetime;
}
public String getInventoryMasterUnitCode() {
return inventoryMasterUnitCode;
}
public void setInventoryMasterUnitCode(String inventoryMasterUnitCode) {
this.inventoryMasterUnitCode = inventoryMasterUnitCode;
}
public String getInventoryMasterUnitZhl() {
return inventoryMasterUnitZhl;
}
public void setInventoryMasterUnitZhl(String inventoryMasterUnitZhl) {
this.inventoryMasterUnitZhl = inventoryMasterUnitZhl;
}
public String getInventoryUnitCode() {
return inventoryUnitCode;
}
public void setInventoryUnitCode(String inventoryUnitCode) {
this.inventoryUnitCode = inventoryUnitCode;
}
public String getInventoryUnitZhl() {
return inventoryUnitZhl;
}
public void setInventoryUnitZhl(String inventoryUnitZhl) {
this.inventoryUnitZhl = inventoryUnitZhl;
}
public String getSale_price() {
return sale_price;
}
public void setSale_price(String sale_price) {
this.sale_price = sale_price;
}
public String getCost_price() {
return cost_price;
}
public void setCost_price(String cost_price) {
this.cost_price = cost_price;
}
public String getHas_sale_item() {
return has_sale_item;
}
public void setHas_sale_item(String has_sale_item) {
this.has_sale_item = has_sale_item;
}
public String getHas_weigh_item() {
return has_weigh_item;
}
public void setHas_weigh_item(String has_weigh_item) {
this.has_weigh_item = has_weigh_item;
}
public String getCost_price_spr() {
return cost_price_spr;
}
public void setCost_price_spr(String cost_price_spr) {
this.cost_price_spr = cost_price_spr;
}
public String getCostType() {
return costType;
}
public void setCostType(String costType) {
this.costType = costType;
}
public String getInventoryPurchasingUnitZhl() {
return inventoryPurchasingUnitZhl;
}
public void setInventoryPurchasingUnitZhl(String inventoryPurchasingUnitZhl) {
this.inventoryPurchasingUnitZhl = inventoryPurchasingUnitZhl;
}
public String getInventorySaleUnitZhl() {
return inventorySaleUnitZhl;
}
public void setInventorySaleUnitZhl(String inventorySaleUnitZhl) {
this.inventorySaleUnitZhl = inventorySaleUnitZhl;
}
public String getPurchasingUnitCode() {
return purchasingUnitCode;
}
public void setPurchasingUnitCode(String purchasingUnitCode) {
this.purchasingUnitCode = purchasingUnitCode;
}
public String getSaleUnitCode() {
return saleUnitCode;
}
public void setSaleUnitCode(String saleUnitCode) {
this.saleUnitCode = saleUnitCode;
}
}

View File

@ -0,0 +1,464 @@
<?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.u9c.itemmaster.dao.impl.VU9cItemmasterDaoImpl">
<resultMap id="get-VU9cItemmasterEntity-result" type="com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity" >
<result property="code" column="CODE" jdbcType="VARCHAR"/>
<result property="name" column="NAME" jdbcType="VARCHAR"/>
<result property="categoryId" column="category_id" jdbcType="VARCHAR"/>
<result property="classificationCode" column="classification_code" jdbcType="VARCHAR"/>
<result property="classificationName" column="classification_name" jdbcType="VARCHAR"/>
<result property="crmCategoryId" column="crmCategoryId" jdbcType="VARCHAR"/>
<result property="crmId" column="crmId" jdbcType="VARCHAR"/>
<result property="operatorsId" column="operatorsId" jdbcType="VARCHAR"/>
<result property="unitCode" column="unitCode" jdbcType="VARCHAR"/>
<result property="dataId" column="dataId" jdbcType="VARCHAR"/>
<result property="unitName" column="unitName" jdbcType="VARCHAR"/>
<result property="specs" column="specs" jdbcType="VARCHAR"/>
<result property="sukCode" column="suk_code" jdbcType="VARCHAR"/>
<result property="referenceCode" column="reference_code" jdbcType="VARCHAR"/>
<result property="materialForm" column="material_form" jdbcType="VARCHAR"/>
<result property="inventoryTransactions" column="inventory_transactions" jdbcType="VARCHAR"/>
<result property="procure" column="procure" jdbcType="VARCHAR"/>
<result property="sale" column="sale" jdbcType="VARCHAR"/>
<result property="produce" column="produce" jdbcType="VARCHAR"/>
<result property="mrp" column="mrp" jdbcType="VARCHAR"/>
<result property="bom" column="bom" jdbcType="VARCHAR"/>
<result property="doubleUnit" column="double_unit" jdbcType="VARCHAR"/>
<result property="multiUnit" column="multi_unit" jdbcType="VARCHAR"/>
<result property="conversionRate" column="conversion_rate" jdbcType="VARCHAR"/>
<result property="reserved" column="reserved" jdbcType="VARCHAR"/>
<result property="batchNumber" column="batch_number" jdbcType="VARCHAR"/>
<result property="pricingSource" column="pricing_source" jdbcType="VARCHAR"/>
<result property="receivingProcedure" column="receiving_procedure" jdbcType="VARCHAR"/>
<result property="inventoryMasterUnit" column="inventory_master_unit" jdbcType="VARCHAR"/>
<result property="inventoryMasterUnitCode" column="inventory_master_unit_code" jdbcType="VARCHAR"/>
<result property="inventoryMasterUnitZhl" column="inventory_master_unit_zhl" jdbcType="VARCHAR"/>
<result property="inventoryUnit" column="inventory_unit" jdbcType="VARCHAR"/>
<result property="inventoryUnitCode" column="inventory_unit_code" jdbcType="VARCHAR"/>
<result property="inventoryUnitZhl" column="inventory_unit_zhl" jdbcType="VARCHAR"/>
<result property="purchasingUnit" column="purchasing_unit" jdbcType="VARCHAR"/>
<result property="saleUnit" column="sale_unit" jdbcType="VARCHAR"/>
<result property="productionUnit" column="production_unit" jdbcType="VARCHAR"/>
<result property="materialRequisitionUnit" column="material_requisition_unit" jdbcType="VARCHAR"/>
<result property="pricingUnit" column="pricing_unit" jdbcType="VARCHAR"/>
<result property="weightUnit" column="weight_unit" jdbcType="VARCHAR"/>
<result property="volumeUnit" column="volume_unit" jdbcType="VARCHAR"/>
<result property="costUnit" column="cost_unit" jdbcType="VARCHAR"/>
<result property="sale_price" column="sale_price" jdbcType="VARCHAR"/>
<result property="cost_price" column="cost_price" jdbcType="VARCHAR"/>
<result property="cost_price_spr" column="cost_price_spr" jdbcType="VARCHAR"/>
<result property="has_sale_item" column="has_sale_item" jdbcType="VARCHAR"/>
<result property="has_weigh_item" column="has_weigh_item" jdbcType="VARCHAR"/>
<result property="updatetime" column="update_time" jdbcType="VARCHAR"/>
<result property="LotValidDate" column="LotValidDate" jdbcType="VARCHAR"/>
<result property="standardPrice" column="standard_price" jdbcType="VARCHAR"/>
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
<result property="nameOrg" column="name_org" jdbcType="VARCHAR"/>
<result property="crmCostPrice" column="crm_cost_price" jdbcType="VARCHAR"/>
<result property="CRMSalesRate" column="CRMSalesRate" jdbcType="VARCHAR"/>
<result property="Effective_IsEffective" column="Effective_IsEffective" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cItemmasterEntity_Base_Column_List">
CODE
LotValidDate
,NAME
,category_id
,classification_code
,standard_price
,classification_name
,crmCategoryId
,crmId
,operatorsId
,unitCode
,dataId
,unitName
,specs
,suk_code
,reference_code
,material_form
,inventory_transactions
,procure
,sale
,produce
,mrp
,bom
,double_unit
,multi_unit
,conversion_rate
,reserved
,batch_number
,pricing_source
,receiving_procedure
,inventory_master_unit
,inventory_master_unit_code
,inventory_master_unit_zhl
,inventory_unit
,inventory_unit_code
,inventory_unit_zhl
,purchasing_unit
,sale_unit
,production_unit
,material_requisition_unit
,pricing_unit
,weight_unit
,volume_unit
,cost_unit
,sale_price
,cost_price
,cost_price_spr
,has_sale_item
,has_weigh_item
,update_time
</sql>
<!--睿本云专用-->
<resultMap id="get-VU9cItemmasterEntity-result_reabam" type="com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity" >
<result property="code" column="CODE" jdbcType="VARCHAR"/>
<result property="name" column="NAME" jdbcType="VARCHAR"/>
<result property="categoryId" column="category_id" jdbcType="VARCHAR"/>
<result property="classificationCode" column="classification_code" jdbcType="VARCHAR"/>
<result property="classificationName" column="classification_name" jdbcType="VARCHAR"/>
<result property="crmCategoryId" column="crmCategoryId" jdbcType="VARCHAR"/>
<result property="crmId" column="crmId" jdbcType="VARCHAR"/>
<result property="costType" column="costType" jdbcType="VARCHAR"/>
<result property="operatorsId" column="operatorsId" jdbcType="VARCHAR"/>
<result property="unitCode" column="unitCode" jdbcType="VARCHAR"/>
<result property="dataId" column="dataId" jdbcType="VARCHAR"/>
<result property="unitName" column="unitName" jdbcType="VARCHAR"/>
<result property="specs" column="specs" jdbcType="VARCHAR"/>
<result property="sukCode" column="suk_code" jdbcType="VARCHAR"/>
<result property="referenceCode" column="reference_code" jdbcType="VARCHAR"/>
<result property="materialForm" column="material_form" jdbcType="VARCHAR"/>
<result property="inventoryTransactions" column="inventory_transactions" jdbcType="VARCHAR"/>
<result property="procure" column="procure" jdbcType="VARCHAR"/>
<result property="sale" column="sale" jdbcType="VARCHAR"/>
<result property="produce" column="produce" jdbcType="VARCHAR"/>
<result property="mrp" column="mrp" jdbcType="VARCHAR"/>
<result property="bom" column="bom" jdbcType="VARCHAR"/>
<result property="doubleUnit" column="double_unit" jdbcType="VARCHAR"/>
<result property="multiUnit" column="multi_unit" jdbcType="VARCHAR"/>
<result property="conversionRate" column="conversion_rate" jdbcType="VARCHAR"/>
<result property="reserved" column="reserved" jdbcType="VARCHAR"/>
<result property="batchNumber" column="batch_number" jdbcType="VARCHAR"/>
<result property="pricingSource" column="pricing_source" jdbcType="VARCHAR"/>
<result property="receivingProcedure" column="receiving_procedure" jdbcType="VARCHAR"/>
<result property="inventoryMasterUnit" column="inventory_master_unit" jdbcType="VARCHAR"/>
<result property="inventoryMasterUnitCode" column="inventory_master_unit_code" jdbcType="VARCHAR"/>
<result property="inventoryMasterUnitZhl" column="inventory_master_unit_zhl" jdbcType="VARCHAR"/>
<result property="inventoryUnit" column="inventory_unit" jdbcType="VARCHAR"/>
<result property="inventoryUnitCode" column="inventory_unit_code" jdbcType="VARCHAR"/>
<result property="inventoryUnitZhl" column="inventory_unit_zhl" jdbcType="VARCHAR"/>
<result property="purchasingUnit" column="purchasing_unit" jdbcType="VARCHAR"/>
<result property="inventoryPurchasingUnitZhl" column="inventory_purchasing_unit_zhl" jdbcType="VARCHAR"/>
<result property="saleUnit" column="sale_unit" jdbcType="VARCHAR"/>
<result property="saleUnitCode" column="sale_unit_code" jdbcType="VARCHAR"/>
<result property="inventorySaleUnitZhl" column="inventory_sale_unit_zhl" jdbcType="VARCHAR"/>
<result property="productionUnit" column="production_unit" jdbcType="VARCHAR"/>
<result property="materialRequisitionUnit" column="material_requisition_unit" jdbcType="VARCHAR"/>
<result property="pricingUnit" column="pricing_unit" jdbcType="VARCHAR"/>
<result property="purchasingUnitCode" column="purchasing_unit_code" jdbcType="VARCHAR"/>
<result property="weightUnit" column="weight_unit" jdbcType="VARCHAR"/>
<result property="volumeUnit" column="volume_unit" jdbcType="VARCHAR"/>
<result property="costUnit" column="cost_unit" jdbcType="VARCHAR"/>
<result property="sale_price" column="sale_price" jdbcType="VARCHAR"/>
<result property="cost_price" column="cost_price" jdbcType="VARCHAR"/>
<result property="cost_price_spr" column="cost_price_spr" jdbcType="VARCHAR"/>
<result property="has_sale_item" column="has_sale_item" jdbcType="VARCHAR"/>
<result property="has_weigh_item" column="has_weigh_item" jdbcType="VARCHAR"/>
<result property="updatetime" column="update_time" jdbcType="VARCHAR"/>
<result property="LotValidDate" column="LotValidDate" jdbcType="VARCHAR"/>
<result property="standardPrice" column="standard_price" jdbcType="VARCHAR"/>
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
<result property="nameOrg" column="name_org" jdbcType="VARCHAR"/>
<result property="crmCostPrice" column="crm_cost_price" jdbcType="VARCHAR"/>
<result property="CRMSalesRate" column="CRMSalesRate" jdbcType="VARCHAR"/>
<result property="Effective_IsEffective" column="Effective_IsEffective" jdbcType="VARCHAR"/>
</resultMap>
<!--睿本云专用-->
<!-- 查询的字段-->
<sql id = "VU9cItemmasterEntity_Base_Column_List_reabam">
CODE,
LotValidDate
,NAME
,category_id
,classification_code
,classification_name
,crmCategoryId
,crmId
,costType
,operatorsId
,unitCode
,dataId
,unitName
,specs
,suk_code
,reference_code
,material_form
,inventory_transactions
,procure
,sale
,produce
,mrp
,bom
,double_unit
,multi_unit
,conversion_rate
,reserved
,batch_number
,pricing_source
,receiving_procedure
,inventory_master_unit
,inventory_master_unit_code
,inventory_master_unit_zhl
,inventory_unit
,inventory_unit_code
,inventory_unit_zhl
,purchasing_unit
,inventory_purchasing_unit_zhl
,sale_unit
,sale_unit_code
,inventory_sale_unit_zhl
,production_unit
,purchasing_unit_code
,material_requisition_unit
,pricing_unit
,weight_unit
,volume_unit
,cost_unit
,sale_price
,cost_price
,cost_price_spr
,has_sale_item
,has_weigh_item
,update_time
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-VU9cItemmasterEntity-result" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
select
<include refid="VU9cItemmasterEntity_Base_Column_List" />
from v_u9c_itemmaster
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> and CODE = #{code} </if>
<if test="name != null and name != ''"> and NAME = #{name} </if>
<if test="categoryId != null and categoryId != ''"> and category_id = #{categoryId} </if>
<if test="classificationCode != null and classificationCode != ''"> and classification_code = #{classificationCode} </if>
<if test="classificationName != null and classificationName != ''"> and classification_name = #{classificationName} </if>
<if test="crmCategoryId != null and crmCategoryId != ''"> and crmCategoryId = #{crmCategoryId} </if>
<if test="crmId != null and crmId != ''"> and crmId = #{crmId} </if>
<if test="operatorsId != null and operatorsId != ''"> and operatorsId = #{operatorsId} </if>
<if test="unitCode != null and unitCode != ''"> and unitCode = #{unitCode} </if>
<if test="dataId != null and dataId != ''"> and dataId = #{dataId} </if>
<if test="unitName != null and unitName != ''"> and unitName = #{unitName} </if>
<if test="specs != null and specs != ''"> and specs = #{specs} </if>
<if test="sukCode != null and sukCode != ''"> and suk_code = #{sukCode} </if>
<if test="referenceCode != null and referenceCode != ''"> and reference_code = #{referenceCode} </if>
<if test="materialForm != null and materialForm != ''"> and material_form = #{materialForm} </if>
<if test="inventoryTransactions != null and inventoryTransactions != ''"> and inventory_transactions = #{inventoryTransactions} </if>
<if test="procure != null and procure != ''"> and procure = #{procure} </if>
<if test="sale != null and sale != ''"> and sale = #{sale} </if>
<if test="produce != null and produce != ''"> and produce = #{produce} </if>
<if test="mrp != null and mrp != ''"> and mrp = #{mrp} </if>
<if test="bom != null and bom != ''"> and bom = #{bom} </if>
<if test="doubleUnit != null and doubleUnit != ''"> and double_unit = #{doubleUnit} </if>
<if test="multiUnit != null and multiUnit != ''"> and multi_unit = #{multiUnit} </if>
<if test="conversionRate != null and conversionRate != ''"> and conversion_rate = #{conversionRate} </if>
<if test="reserved != null and reserved != ''"> and reserved = #{reserved} </if>
<if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber} </if>
<if test="pricingSource != null and pricingSource != ''"> and pricing_source = #{pricingSource} </if>
<if test="receivingProcedure != null and receivingProcedure != ''"> and receiving_procedure = #{receivingProcedure} </if>
<if test="inventoryMasterUnit != null and inventoryMasterUnit != ''"> and inventory_master_unit = #{inventoryMasterUnit} </if>
<if test="inventoryUnit != null and inventoryUnit != ''"> and inventory_unit = #{inventoryUnit} </if>
<if test="purchasingUnit != null and purchasingUnit != ''"> and purchasing_unit = #{purchasingUnit} </if>
<if test="saleUnit != null and saleUnit != ''"> and sale_unit = #{saleUnit} </if>
<if test="productionUnit != null and productionUnit != ''"> and production_unit = #{productionUnit} </if>
<if test="materialRequisitionUnit != null and materialRequisitionUnit != ''"> and material_requisition_unit = #{materialRequisitionUnit} </if>
<if test="pricingUnit != null and pricingUnit != ''"> and pricing_unit = #{pricingUnit} </if>
<if test="weightUnit != null and weightUnit != ''"> and weight_unit = #{weightUnit} </if>
<if test="volumeUnit != null and volumeUnit != ''"> and volume_unit = #{volumeUnit} </if>
<if test="costUnit != null and costUnit != ''"> and cost_unit = #{costUnit} </if>
<if test="updatetime != null and updatetime != ''"> and update_time = #{updatetime} </if>
<if test="proType != null and proType != ''"> and proType = #{proType} </if>
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
select count(1) from v_u9c_itemmaster
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> and CODE = #{code} </if>
<if test="name != null and name != ''"> and NAME = #{name} </if>
<if test="categoryId != null and categoryId != ''"> and category_id = #{categoryId} </if>
<if test="classificationCode != null and classificationCode != ''"> and classification_code = #{classificationCode} </if>
<if test="classificationName != null and classificationName != ''"> and classification_name = #{classificationName} </if>
<if test="crmCategoryId != null and crmCategoryId != ''"> and crmCategoryId = #{crmCategoryId} </if>
<if test="crmId != null and crmId != ''"> and crmId = #{crmId} </if>
<if test="operatorsId != null and operatorsId != ''"> and operatorsId = #{operatorsId} </if>
<if test="unitCode != null and unitCode != ''"> and unitCode = #{unitCode} </if>
<if test="dataId != null and dataId != ''"> and dataId = #{dataId} </if>
<if test="unitName != null and unitName != ''"> and unitName = #{unitName} </if>
<if test="specs != null and specs != ''"> and specs = #{specs} </if>
<if test="sukCode != null and sukCode != ''"> and suk_code = #{sukCode} </if>
<if test="referenceCode != null and referenceCode != ''"> and reference_code = #{referenceCode} </if>
<if test="materialForm != null and materialForm != ''"> and material_form = #{materialForm} </if>
<if test="inventoryTransactions != null and inventoryTransactions != ''"> and inventory_transactions = #{inventoryTransactions} </if>
<if test="procure != null and procure != ''"> and procure = #{procure} </if>
<if test="sale != null and sale != ''"> and sale = #{sale} </if>
<if test="produce != null and produce != ''"> and produce = #{produce} </if>
<if test="mrp != null and mrp != ''"> and mrp = #{mrp} </if>
<if test="bom != null and bom != ''"> and bom = #{bom} </if>
<if test="doubleUnit != null and doubleUnit != ''"> and double_unit = #{doubleUnit} </if>
<if test="multiUnit != null and multiUnit != ''"> and multi_unit = #{multiUnit} </if>
<if test="conversionRate != null and conversionRate != ''"> and conversion_rate = #{conversionRate} </if>
<if test="reserved != null and reserved != ''"> and reserved = #{reserved} </if>
<if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber} </if>
<if test="pricingSource != null and pricingSource != ''"> and pricing_source = #{pricingSource} </if>
<if test="receivingProcedure != null and receivingProcedure != ''"> and receiving_procedure = #{receivingProcedure} </if>
<if test="inventoryMasterUnit != null and inventoryMasterUnit != ''"> and inventory_master_unit = #{inventoryMasterUnit} </if>
<if test="inventoryUnit != null and inventoryUnit != ''"> and inventory_unit = #{inventoryUnit} </if>
<if test="purchasingUnit != null and purchasingUnit != ''"> and purchasing_unit = #{purchasingUnit} </if>
<if test="saleUnit != null and saleUnit != ''"> and sale_unit = #{saleUnit} </if>
<if test="productionUnit != null and productionUnit != ''"> and production_unit = #{productionUnit} </if>
<if test="materialRequisitionUnit != null and materialRequisitionUnit != ''"> and material_requisition_unit = #{materialRequisitionUnit} </if>
<if test="pricingUnit != null and pricingUnit != ''"> and pricing_unit = #{pricingUnit} </if>
<if test="weightUnit != null and weightUnit != ''"> and weight_unit = #{weightUnit} </if>
<if test="volumeUnit != null and volumeUnit != ''"> and volume_unit = #{volumeUnit} </if>
<if test="costUnit != null and costUnit != ''"> and cost_unit = #{costUnit} </if>
<if test="updatetime != null and updatetime != ''"> and update_time = #{updatetime} </if>
</trim>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VU9cItemmasterEntity-result" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
select
<include refid="VU9cItemmasterEntity_Base_Column_List" />
from v_u9c_itemmaster
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> and CODE like concat('%',#{code},'%') </if>
<if test="name != null and name != ''"> and NAME like concat('%',#{name},'%') </if>
<if test="categoryId != null and categoryId != ''"> and category_id like concat('%',#{categoryId},'%') </if>
<if test="classificationCode != null and classificationCode != ''"> and classification_code like concat('%',#{classificationCode},'%') </if>
<if test="classificationName != null and classificationName != ''"> and classification_name like concat('%',#{classificationName},'%') </if>
<if test="crmCategoryId != null and crmCategoryId != ''"> and crmCategoryId like concat('%',#{crmCategoryId},'%') </if>
<if test="crmId != null and crmId != ''"> and crmId like concat('%',#{crmId},'%') </if>
<if test="operatorsId != null and operatorsId != ''"> and operatorsId like concat('%',#{operatorsId},'%') </if>
<if test="unitCode != null and unitCode != ''"> and unitCode like concat('%',#{unitCode},'%') </if>
<if test="dataId != null and dataId != ''"> and dataId like concat('%',#{dataId},'%') </if>
<if test="unitName != null and unitName != ''"> and unitName like concat('%',#{unitName},'%') </if>
<if test="specs != null and specs != ''"> and specs like concat('%',#{specs},'%') </if>
<if test="sukCode != null and sukCode != ''"> and suk_code like concat('%',#{sukCode},'%') </if>
<if test="referenceCode != null and referenceCode != ''"> and reference_code like concat('%',#{referenceCode},'%') </if>
<if test="materialForm != null and materialForm != ''"> and material_form like concat('%',#{materialForm},'%') </if>
<if test="inventoryTransactions != null and inventoryTransactions != ''"> and inventory_transactions like concat('%',#{inventoryTransactions},'%') </if>
<if test="procure != null and procure != ''"> and procure like concat('%',#{procure},'%') </if>
<if test="sale != null and sale != ''"> and sale like concat('%',#{sale},'%') </if>
<if test="produce != null and produce != ''"> and produce like concat('%',#{produce},'%') </if>
<if test="mrp != null and mrp != ''"> and mrp like concat('%',#{mrp},'%') </if>
<if test="bom != null and bom != ''"> and bom like concat('%',#{bom},'%') </if>
<if test="doubleUnit != null and doubleUnit != ''"> and double_unit like concat('%',#{doubleUnit},'%') </if>
<if test="multiUnit != null and multiUnit != ''"> and multi_unit like concat('%',#{multiUnit},'%') </if>
<if test="conversionRate != null and conversionRate != ''"> and conversion_rate like concat('%',#{conversionRate},'%') </if>
<if test="reserved != null and reserved != ''"> and reserved like concat('%',#{reserved},'%') </if>
<if test="batchNumber != null and batchNumber != ''"> and batch_number like concat('%',#{batchNumber},'%') </if>
<if test="pricingSource != null and pricingSource != ''"> and pricing_source like concat('%',#{pricingSource},'%') </if>
<if test="receivingProcedure != null and receivingProcedure != ''"> and receiving_procedure like concat('%',#{receivingProcedure},'%') </if>
<if test="inventoryMasterUnit != null and inventoryMasterUnit != ''"> and inventory_master_unit like concat('%',#{inventoryMasterUnit},'%') </if>
<if test="inventoryUnit != null and inventoryUnit != ''"> and inventory_unit like concat('%',#{inventoryUnit},'%') </if>
<if test="purchasingUnit != null and purchasingUnit != ''"> and purchasing_unit like concat('%',#{purchasingUnit},'%') </if>
<if test="saleUnit != null and saleUnit != ''"> and sale_unit like concat('%',#{saleUnit},'%') </if>
<if test="productionUnit != null and productionUnit != ''"> and production_unit like concat('%',#{productionUnit},'%') </if>
<if test="materialRequisitionUnit != null and materialRequisitionUnit != ''"> and material_requisition_unit like concat('%',#{materialRequisitionUnit},'%') </if>
<if test="pricingUnit != null and pricingUnit != ''"> and pricing_unit like concat('%',#{pricingUnit},'%') </if>
<if test="weightUnit != null and weightUnit != ''"> and weight_unit like concat('%',#{weightUnit},'%') </if>
<if test="volumeUnit != null and volumeUnit != ''"> and volume_unit like concat('%',#{volumeUnit},'%') </if>
<if test="costUnit != null and costUnit != ''"> and cost_unit like concat('%',#{costUnit},'%') </if>
<if test="updatetime != null and updatetime != ''"> and update_time like concat('%',#{updatetime},'%') </if>
</trim>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="VU9cItemmasterentity_list_or" resultMap="get-VU9cItemmasterEntity-result" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
select
<include refid="VU9cItemmasterEntity_Base_Column_List" />
from v_u9c_itemmaster
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> or CODE = #{code} </if>
<if test="name != null and name != ''"> or NAME = #{name} </if>
<if test="categoryId != null and categoryId != ''"> or category_id = #{categoryId} </if>
<if test="classificationCode != null and classificationCode != ''"> or classification_code = #{classificationCode} </if>
<if test="classificationName != null and classificationName != ''"> or classification_name = #{classificationName} </if>
<if test="crmCategoryId != null and crmCategoryId != ''"> or crmCategoryId = #{crmCategoryId} </if>
<if test="crmId != null and crmId != ''"> or crmId = #{crmId} </if>
<if test="operatorsId != null and operatorsId != ''"> or operatorsId = #{operatorsId} </if>
<if test="unitCode != null and unitCode != ''"> or unitCode = #{unitCode} </if>
<if test="dataId != null and dataId != ''"> or dataId = #{dataId} </if>
<if test="unitName != null and unitName != ''"> or unitName = #{unitName} </if>
<if test="specs != null and specs != ''"> or specs = #{specs} </if>
<if test="sukCode != null and sukCode != ''"> or suk_code = #{sukCode} </if>
<if test="referenceCode != null and referenceCode != ''"> or reference_code = #{referenceCode} </if>
<if test="materialForm != null and materialForm != ''"> or material_form = #{materialForm} </if>
<if test="inventoryTransactions != null and inventoryTransactions != ''"> or inventory_transactions = #{inventoryTransactions} </if>
<if test="procure != null and procure != ''"> or procure = #{procure} </if>
<if test="sale != null and sale != ''"> or sale = #{sale} </if>
<if test="produce != null and produce != ''"> or produce = #{produce} </if>
<if test="mrp != null and mrp != ''"> or mrp = #{mrp} </if>
<if test="bom != null and bom != ''"> or bom = #{bom} </if>
<if test="doubleUnit != null and doubleUnit != ''"> or double_unit = #{doubleUnit} </if>
<if test="multiUnit != null and multiUnit != ''"> or multi_unit = #{multiUnit} </if>
<if test="conversionRate != null and conversionRate != ''"> or conversion_rate = #{conversionRate} </if>
<if test="reserved != null and reserved != ''"> or reserved = #{reserved} </if>
<if test="batchNumber != null and batchNumber != ''"> or batch_number = #{batchNumber} </if>
<if test="pricingSource != null and pricingSource != ''"> or pricing_source = #{pricingSource} </if>
<if test="receivingProcedure != null and receivingProcedure != ''"> or receiving_procedure = #{receivingProcedure} </if>
<if test="inventoryMasterUnit != null and inventoryMasterUnit != ''"> or inventory_master_unit = #{inventoryMasterUnit} </if>
<if test="inventoryUnit != null and inventoryUnit != ''"> or inventory_unit = #{inventoryUnit} </if>
<if test="purchasingUnit != null and purchasingUnit != ''"> or purchasing_unit = #{purchasingUnit} </if>
<if test="saleUnit != null and saleUnit != ''"> or sale_unit = #{saleUnit} </if>
<if test="productionUnit != null and productionUnit != ''"> or production_unit = #{productionUnit} </if>
<if test="materialRequisitionUnit != null and materialRequisitionUnit != ''"> or material_requisition_unit = #{materialRequisitionUnit} </if>
<if test="pricingUnit != null and pricingUnit != ''"> or pricing_unit = #{pricingUnit} </if>
<if test="weightUnit != null and weightUnit != ''"> or weight_unit = #{weightUnit} </if>
<if test="volumeUnit != null and volumeUnit != ''"> or volume_unit = #{volumeUnit} </if>
<if test="costUnit != null and costUnit != ''"> or cost_unit = #{costUnit} </if>
<if test="updatetime != null and updatetime != ''"> or update_time = #{updatetime} </if>
</trim>
</select>
<!-- 查询 采用==查询 -->
<select id="entity_list_base_item_master" resultMap="get-VU9cItemmasterEntity-result" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
select * from v_u9c_itemmaster_org_crm where update_time > #{updatetime}
</select>
<!--通过主键修改方法-->
<update id="entity_update_item_master" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity" >
update CBO_ItemMaster set
DescFlexField_PrivateDescSeg1 = DescFlexField_PrivateDescSeg1+#{dataId}
where id= #{id}
</update>
<!-- 查询物料,推送睿本云专用 -->
<select id="VU9cItemmasterEntity_entity_list_base_reabam" resultMap="get-VU9cItemmasterEntity-result_reabam" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
select
<include refid="VU9cItemmasterEntity_Base_Column_List_reabam" />
from v_u9c_itemmaster
<trim prefix="where" prefixOverrides="and">
<if test="code != null and code != ''"> and CODE = #{code} </if>
<if test="name != null and name != ''"> and NAME = #{name} </if>
<if test="updatetime != null and updatetime != ''"> and update_time >= #{updatetime} </if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,44 @@
package com.hzya.frame.u9c.itemmaster.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.web.entity.JsonResultEntity;
import java.util.List;
/**
* (VU9cItemmaster)表服务接口
*
* @author xiaoguo
* @since 2023-10-25 14:30:37
*/
public interface IVU9cItemmasterService extends IBaseService<VU9cItemmasterEntity, String>{
/***
* @Content:查询U9C料品档案
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月25日14:40:29
* @Param
* @return
**/
String sendU9cItemmasterToCRM();
/****
* 查询U9C物料档案方法
* @content:
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-10-25 16:05
* @param requestObj 查询条件
* @return com.alibaba.fastjson.JSONObject
**/
JsonResultEntity queryU9cItemMaster(JSONObject requestObj);
/**
* 查询U9C物料档案 同步睿本云专用接口
* @param entity 参数
* @return 物料档案
*/
List<VU9cItemmasterEntity> query2Reabam(VU9cItemmasterEntity entity);
}

View File

@ -0,0 +1,343 @@
package com.hzya.frame.u9c.itemmaster.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.constant.U9Constant;
import com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity;
import com.hzya.frame.u9c.itemmaster.dao.IVU9cItemmasterDao;
import com.hzya.frame.u9c.itemmaster.service.IVU9cItemmasterService;
import com.hzya.frame.u9c.util.CrmUtil;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
/**
* (VU9cItemmaster)表服务实现类
*
* @author xiaoguo
* @since 2023-10-25 14:30:38
*/
@Service(value = "vU9cItemmasterService")
public class VU9cItemmasterServiceImpl extends BaseService<VU9cItemmasterEntity, String> implements IVU9cItemmasterService {
private IVU9cItemmasterDao vU9cItemmasterDao;
@Autowired
public void setVU9cItemmasterDao(IVU9cItemmasterDao dao) {
this.vU9cItemmasterDao = dao;
this.dao = dao;
}
@Override
public JsonResultEntity queryU9cItemMaster(JSONObject requestObj) {
List<VU9cItemmasterEntity> vu9cItemmasterEntities = new ArrayList<>();
return BaseResult.getFailureMessageEntity("获取数据成功",vu9cItemmasterEntities);
}
/**
* 查询U9C物料档案 同步睿本云专用接口
*
* @param entity 参数
* @return 物料档案
*/
@DS(U9Constant.DATA_SOURCE_CODE)
@Override
public List<VU9cItemmasterEntity> query2Reabam(VU9cItemmasterEntity entity) {
List<VU9cItemmasterEntity> list = vU9cItemmasterDao.queryList(entity, "VU9cItemmasterEntity_entity_list_base_reabam");
return list;
}
//上一次同步时间
private String LAST_SYNCHRONISED_TIME = "";
@Override
public String sendU9cItemmasterToCRM() {
JSONObject resultObj = new JSONObject();
//获取待推送的U9c
VU9cItemmasterEntity entity = new VU9cItemmasterEntity();
if (StrUtil.isBlank(LAST_SYNCHRONISED_TIME)) {
LAST_SYNCHRONISED_TIME = DateUtil.now();
}
//暂存时间
String temp_time = LAST_SYNCHRONISED_TIME;
entity.setUpdatetime(temp_time);
List<VU9cItemmasterEntity> vu9cItemmasterEntityList = vU9cItemmasterDao.getu9cItemMaster(entity);
if(vu9cItemmasterEntityList.size()>0){
LAST_SYNCHRONISED_TIME = DateUtil.now();
int i = 0;
for(VU9cItemmasterEntity itemmaster : vu9cItemmasterEntityList) {
i++;
try {
String permanentCode = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
//获取token信息
JSONObject tokenObj = CrmUtil.getToken(permanentCode);
//通过产品分类主键获取分类编码信息
String categoryCode ="";
JSONObject category = new JSONObject();
category.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
category.put("corpId",tokenObj.getString("corpId"));//公司
category.put("currentOpenUserId",permanentCode);//操作员主键
JSONObject categoryData = new JSONObject();
String crmCategoryId = itemmaster.getCrmCategoryId();
if(StrUtil.isNotEmpty(crmCategoryId)){
categoryData.put("objectDataId",crmCategoryId);
category.put("data",categoryData);
String apiCode = "8000090005";
resultObj = CrmUtil.sendU9cTOCrmEsb(category.toString(),apiCode);
String errorDescription = resultObj.getString("errorDescription");
if("success".equals(errorDescription)){
JSONObject dataObj = resultObj.getJSONObject("data");
categoryCode = dataObj.getString("code");
}
}
//格式化料品名称拼接公司
String name = itemmaster.getNameOrg();
String orgName = itemmaster.getOrgName();
String orgCode = "";
itemmaster.getProType();
switch (orgName){
case "杭州博华食品科技有限公司":
name = name + "-博华";
orgCode = "a2lmNhpo0";
break;
case "浙江恒华食品科技有限公司":
name = name + "-恒华";
orgCode = "cD2b3f";
break;
case "杭州华耀科技食品有限责任公司":
itemmaster.setProType("");
name = name + "-华耀";
orgCode = "sl2qOPMpO";
break;
case "杭州胡记食品有限公司":
itemmaster.setProType("");
name = name + "-胡记";
orgCode = "eq8LyNWe1";
break;
}
itemmaster.setNameOrg(name);
String requestParm = "";
String apiCode = "";
//通过主键是否为空 判断新增还是更新
String crmId = CrmUtil.getProIdByName(name,tokenObj.getString("corpAccessToken"),permanentCode,tokenObj.getString("corpId"));
//格式化单位信息
//todo 2023年12月18日20:56:48 CRM实施提出将U9C销售计量单位传递到他们单位上
String unitName = itemmaster.getSaleUnit();
String unit = formatUnit(unitName,tokenObj,permanentCode);
//为了防止再次出现本应该是更新却走了新增方法
logger.info("商品新增还是更新的参数"+JSON.toJSONString(itemmaster));
if(StrUtil.isEmpty(crmId)){
requestParm = bindingAdd(itemmaster,tokenObj,permanentCode,categoryCode,unit, orgCode);
apiCode = "8000090000";
}else{
requestParm = bindingEdit(itemmaster,tokenObj,permanentCode,categoryCode,unit,orgCode);
apiCode = "8000090006";
}
resultObj = CrmUtil.sendU9cTOCrmEsb(requestParm,apiCode);
String errorDescription = resultObj.getString("errorDescription");
if("success".equals(errorDescription)){
if(StrUtil.isNotEmpty(crmId)){
//得到商品ID 通过商品ID查询产品信息用于修改产品档案
String proId = CrmUtil.getProIdBySupId(crmId,tokenObj.getString("corpAccessToken"),permanentCode,tokenObj.getString("corpId"));
requestParm = bindingProEdit(itemmaster,tokenObj,permanentCode,categoryCode,unit,proId,orgCode);
apiCode = "8000090014";
logger.info("商品修改→请求数据:{}",requestParm);
resultObj = CrmUtil.sendU9cTOCrmEsb(requestParm,apiCode);
logger.info("商品修改→返回数据:{}",resultObj.toString());
// String dataId = resultObj.getString("dataId");
// if(StrUtil.isNotEmpty(dataId)){
// itemmaster.setDataId(dataId);
// int state = vU9cItemmasterDao.updateItemMaster(itemmaster);
// }
}
}
// System.out.println(resultObj);
} catch (Exception e) {
// itemmaster.setDataId("接口错误,请联系管理员");
logger.info(e.getMessage());
// vU9cItemmasterDao.updateItemMaster(itemmaster);
e.printStackTrace();
}
}
}
return resultObj.toString();
}
/**
*
* @content 组装产品信息修改产品
* @author makejava
* @date 2023/12/17 0017 13:43
*
*/
private String bindingProEdit(VU9cItemmasterEntity itemmaster, JSONObject tokenObj, String permanentCode, String categoryCode, String unit,String proId,String orgCode) {
String Effective_IsEffective = itemmaster.getEffective_IsEffective();
String state = "2";
if(StrUtil.isNotEmpty(Effective_IsEffective)&& "1".equals(Effective_IsEffective)){
state = "1";
}
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
JSONObject object_data = new JSONObject();
JSONObject data = new JSONObject();
data.put("object_data",object_data);
main.put("data",data);
object_data.put("dataObjectApiName","ProductObj");
object_data.put("product_status",state);//上架状态
object_data.put("name",itemmaster.getNameOrg());//产品名称
object_data.put("product_code",itemmaster.getCode());//产品编码
object_data.put("UDSText2__c",itemmaster.getSpecs());//规格
object_data.put("UDSText1__c",itemmaster.getSaleUnit());//销售计量单位
object_data.put("field_HV195__c",itemmaster.getLotValidDate());//保质期
object_data.put("price",itemmaster.getStandardPrice());//标准价格
object_data.put("unit",unit);//单位
object_data.put("field_z5Z43__c",itemmaster.getProType());//产品大类
object_data.put("field_wq5S2__c",itemmaster.getUnitName());//基本计量单位
object_data.put("_id",proId);//基本计量单位
object_data.put("field_s1Mw1__c",itemmaster.getCrmCostPrice());//成本价
object_data.put("field_lmTK1__c",itemmaster.getCRMSalesRate());//销售换算率
object_data.put("field_1J9OY__c",orgCode);//产品归属组织
object_data.put("field_bd1Vb__c",itemmaster.getName());//产品售卖名称
return main.toString();
}
/**
* 绑定新增的参数
*/
public String bindingEdit(VU9cItemmasterEntity itemmaster,JSONObject tokenObj,String permanentCode,String categoryCode,String unit,String orgCode){
//拼接传递参数
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
main.put("duplicateCheck",true);
JSONObject data = new JSONObject();
JSONObject object_data = new JSONObject();
data.put("object_data",object_data);
object_data.put("dataObjectApiName","SPUObj");
String unitName = itemmaster.getUnitName();
object_data.put("unit",unit);//计量单位
JSONArray ownerArr = new JSONArray();
ownerArr.add(permanentCode);
object_data.put("owner",ownerArr);//负责人
object_data.put("is_spec",false);//规格属性
object_data.put("batch_sn","1");//批次与序列号管理默认不开启 有需求再议
object_data.put("field_LwLE9__c",itemmaster.getLotValidDate());//有效期
object_data.put("_id",itemmaster.getCrmId());//批次与序列号管理默认不开启 有需求再议
object_data.put("remark","");//备注
object_data.put("product_line","0");//产品线
object_data.put("name",itemmaster.getNameOrg());//名称
object_data.put("category",categoryCode);//分类
object_data.put("standard_price",itemmaster.getStandardPrice());//标准价格
object_data.put("field_d93lT__c",orgCode);//商品归属组织
object_data.put("field_QB22i__c",itemmaster.getName());//商品售卖名称
object_data.put("field_kU8p1__c",itemmaster.getCrmCostPrice());//成本价格
object_data.put("field_tb4hq__c",itemmaster.getCRMSalesRate());//销售换算率
JSONObject details = new JSONObject();
main.put("data",data);
object_data.put("details",details);
return main.toString();
}
/**
* 绑定新增的参数
*/
public String bindingAdd(VU9cItemmasterEntity itemmaster,JSONObject tokenObj,String permanentCode,String categoryCode,String unit,String orgCode){
//拼接传递参数
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
main.put("duplicateCheck",true);
JSONObject data = new JSONObject();
JSONObject object_data = new JSONObject();
data.put("object_data",object_data);
object_data.put("dataObjectApiName","SPUObj");
String unitName = itemmaster.getUnitName();
object_data.put("unit",unit);//计量单位
JSONArray ownerArr = new JSONArray();
ownerArr.add(permanentCode);
object_data.put("owner",ownerArr);//负责人
object_data.put("is_spec",false);//规格属性
object_data.put("remark","");//备注
object_data.put("product_line","0");//产品线
object_data.put("field_LwLE9__c",itemmaster.getLotValidDate());//有效期
object_data.put("name",itemmaster.getNameOrg());//名称
object_data.put("category",categoryCode);//分类
object_data.put("standard_price",itemmaster.getStandardPrice());//标准价格
object_data.put("field_d93lT__c",orgCode);//商品归属组织
object_data.put("field_QB22i__c",itemmaster.getName());//商品售卖名称
object_data.put("field_kU8p1__c",itemmaster.getCrmCostPrice());//成本价格
object_data.put("field_tb4hq__c",itemmaster.getCRMSalesRate());//销售换算率
JSONObject sku = new JSONObject();
JSONArray skuArr = new JSONArray();
sku.put("object_describe_api_name","ProductObj");
sku.put("product_status","1");
sku.put("name",itemmaster.getNameOrg());//产品编码
sku.put("product_code",itemmaster.getCode());//产品编码
sku.put("UDSText2__c",itemmaster.getSpecs());//规格
sku.put("UDSText1__c",itemmaster.getSaleUnit());//销售计量单位
sku.put("field_HV195__c",itemmaster.getLotValidDate());//保质期
sku.put("price",itemmaster.getStandardPrice());//标准价格
sku.put("unit",unit);//单位
sku.put("field_z5Z43__c",itemmaster.getProType());//产品大类
sku.put("field_wq5S2__c",itemmaster.getUnitName());//基本计量单位
sku.put("field_1J9OY__c",orgCode);//产品归属组织
sku.put("field_bd1Vb__c",itemmaster.getName());//产品售卖名称
sku.put("field_s1Mw1__c",itemmaster.getCrmCostPrice());//成本价
sku.put("field_lmTK1__c",itemmaster.getCRMSalesRate());//销售换算率
main.put("data",data);
skuArr.add(sku);
object_data.put("sku",skuArr);
return main.toString();
}
/**
* 格式化计量单位为CRM单位编码
* @param unitName
* @return
*/
public String formatUnit(String unitName,JSONObject tokenObj ,String permanentCode){
String apiCode = "8000090013";
//获取单位的所有信息
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
main.put("includeDetail",true);
main.put("apiName","SPUObj");
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
JSONObject data = resultObj.getJSONObject("data");
JSONObject describe = data.getJSONObject("describe");
JSONObject fields = describe.getJSONObject("fields");
JSONObject unitObj = fields.getJSONObject("unit");
JSONArray optionsList = unitObj.getJSONArray("options");
if(null != optionsList && optionsList.size()>0){
for(Object options : optionsList){
JSONObject unit = JSON.parseObject(options.toString());
String crmName = unit.getString("label");
if(crmName.equals(unitName)){
return unit.getString("value");
}
}
}
logger.info("未匹配到计量单位单位信息");
return null;
}
}

View File

@ -0,0 +1,66 @@
package com.hzya.frame.u9c.saledeliver.dao;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (view:v_u9c_saledeliver)表数据库访问层
*
* @author makejava
* @since 2023-10-26 11:29:31
*/
public interface IVU9cSaledeliverDao extends IBaseDao<VU9cSaledeliverEntity, String> {
/***
* @Content:获取U9C销售发货单数据
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日13:54:39
* @Param
* @return
**/
List<VU9cSaledeliverEntity> getu9cSaledeliver(VU9cSaledeliverEntity category);
/***
* @Content:更新U9C状态
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日13:54:39
* @Param
* @return
**/
int updateCrmId(VU9cSaledeliverEntity itemmaster);
/**
*
* @content 查询触发器生成的中间表获取已经删除的出货单
* @author makejava
* @date 2024/1/10 0010 10:21
*
*/
List<VU9cSaledeliverEntity> getu9cSaledeliverForDelete(VU9cSaledeliverEntity category);
/**
*
* @content 作废完CRM单据之后调用接口修改删除状态
* @author makejava
* @date 2024/1/10 0010 11:47
*
*/
int updateDeleteState(VU9cSaledeliverEntity entity);
/**
*
* @content 获取所有发生更新的销售退货到货单
* @author javaboy
* @date 2024/1/11 0011 9:38
*
*/
List<VU9cSaledeliverEntity> getu9cSaledeliverForUpdate(VU9cSaledeliverEntity category);
/**
*
* @content 获取所有发生更新的销售退货到货单明细信息
* @author javaboy
* @date 2024/1/11 0011 9:38
*
*/
List<VU9cSaledeliverEntity> getu9cSaledeliverForUpdateDetails(VU9cSaledeliverEntity category);
}

View File

@ -0,0 +1,24 @@
package com.hzya.frame.u9c.saledeliver.dao;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (view:v_u9c_saledeliver_details)表数据库访问层
*
* @author makejava
* @since 2023-11-07 11:12:56
*/
public interface IVU9cSaledeliverDetailsDao extends IBaseDao<VU9cSaledeliverDetailsEntity, String> {
/***
* @Content:查询出库单明细信息
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年11月7日14:20:16
* @Param
* @return
**/
List<VU9cSaledeliverDetailsEntity> getu9cSaledeliverDetails(VU9cSaledeliverDetailsEntity invDetails);
}

View File

@ -0,0 +1,50 @@
package com.hzya.frame.u9c.saledeliver.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity;
import com.hzya.frame.u9c.saledeliver.dao.IVU9cSaledeliverDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (VU9cSaledeliver)表数据库访问层
*
* @author makejava
* @since 2023-10-26 11:29:50
*/
@Repository("VU9cSaledeliverDaoImpl")
public class VU9cSaledeliverDaoImpl extends MybatisGenericDao<VU9cSaledeliverEntity, String> implements IVU9cSaledeliverDao{
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cSaledeliverEntity> getu9cSaledeliver(VU9cSaledeliverEntity category) {
return (List<VU9cSaledeliverEntity>) super.selectList("com.hzya.frame.u9c.saledeliver.dao.impl.VU9cSaledeliverEntityDaoImpl.VU9cSaledeliverEntity_list_base",category);
}
@DS("henghua_sqlserver_test_xel")
@Override
public int updateCrmId(VU9cSaledeliverEntity itemmaster) {
return super.update("com.hzya.frame.u9c.saledeliver.dao.impl.VU9cSaledeliverEntityDaoImpl.entity_update",itemmaster);
}
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cSaledeliverEntity> getu9cSaledeliverForDelete(VU9cSaledeliverEntity category) {
return (List<VU9cSaledeliverEntity>) super.selectList("com.hzya.frame.u9c.saledeliver.dao.impl.VU9cSaledeliverEntityDaoImpl.VU9cSaledeliverEntity_list_base_for_delete",category);
}
@DS("henghua_sqlserver_test_xel")
@Override
public int updateDeleteState(VU9cSaledeliverEntity entity) {
return super.update("com.hzya.frame.u9c.saledeliver.dao.impl.VU9cSaledeliverEntityDaoImpl.entity_update_for_delete",entity);
}
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cSaledeliverEntity> getu9cSaledeliverForUpdate(VU9cSaledeliverEntity category) {
return (List<VU9cSaledeliverEntity>) super.selectList("com.hzya.frame.u9c.saledeliver.dao.impl.VU9cSaledeliverEntityDaoImpl.VU9cSaledeliverEntity_list_base_for_update",category);
}
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cSaledeliverEntity> getu9cSaledeliverForUpdateDetails(VU9cSaledeliverEntity category) {
return (List<VU9cSaledeliverEntity>) super.selectList("com.hzya.frame.u9c.saledeliver.dao.impl.VU9cSaledeliverEntityDaoImpl.VU9cSaledeliverEntity_list_base_for_update_details",category);
}
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.u9c.saledeliver.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity;
import com.hzya.frame.u9c.saledeliver.dao.IVU9cSaledeliverDetailsDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (VU9cSaledeliverDetails)表数据库访问层
*
* @author makejava
* @since 2023-11-07 11:12:58
*/
@Repository("VU9cSaledeliverDetailsDaoImpl")
public class VU9cSaledeliverDetailsDaoImpl extends MybatisGenericDao<VU9cSaledeliverDetailsEntity, String> implements IVU9cSaledeliverDetailsDao{
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cSaledeliverDetailsEntity> getu9cSaledeliverDetails(VU9cSaledeliverDetailsEntity invDetails) {
return (List<VU9cSaledeliverDetailsEntity>) super.selectList("com.hzya.frame.u9c.saledeliver.dao.impl.VU9cSaledeliverDetailsDaoImpl.VU9cSaledeliverDetailsEntity_list_base",invDetails);
}
}

View File

@ -0,0 +1,400 @@
package com.hzya.frame.u9c.saledeliver.entity;
import com.hzya.frame.web.entity.BaseEntity;
import java.math.BigDecimal;
/**
* (VU9cSaledeliverDetails)实体类
*
* @author makejava
* @since 2023-11-07 11:13:00
*/
public class VU9cSaledeliverDetailsEntity extends BaseEntity {
private String rowId;
private String mainId;
private String invCode;
private String invName;
private String spec;
private String num;
private String unitCode;
private String unitName;
private String pricNum;
private String measCode;
private String measName;
private String finalPrice;
private String untaxedAmount;
private String taxAmount;
private String totalPrice;
private String taxCombinationCode;
private String taxCombinationName;
private String storageLocationCode;
private String storageLocationName;
private String batch;
private String period;
private String expiration;
private String updateTime;
private String costAmount;
private String warehouseKeeperCode;
private String warehouseKeeperName;
private String wmsLocationCode;
private String wmsLocationName;
private String deptCode;
private String deptName;
private String salesOrderProductId;
private String crmProId;
private String ShipConfirmDate;
private String TotalNetMoneyTC;
private String TotalMoneyTC;
private BigDecimal TotalMoneyTCNEW;
private BigDecimal OrderByQtyTU;
private String id;
private String salesOrderId;
public String getSalesOrderId() {
return salesOrderId;
}
public void setSalesOrderId(String salesOrderId) {
this.salesOrderId = salesOrderId;
}
public BigDecimal getOrderByQtyTU() {
return OrderByQtyTU;
}
public void setOrderByQtyTU(BigDecimal orderByQtyTU) {
OrderByQtyTU = orderByQtyTU;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public BigDecimal getTotalMoneyTCNEW() {
return TotalMoneyTCNEW;
}
public void setTotalMoneyTCNEW(BigDecimal totalMoneyTCNEW) {
TotalMoneyTCNEW = totalMoneyTCNEW;
}
public String getTotalNetMoneyTC() {
return TotalNetMoneyTC;
}
public void setTotalNetMoneyTC(String totalNetMoneyTC) {
TotalNetMoneyTC = totalNetMoneyTC;
}
public String getTotalMoneyTC() {
return TotalMoneyTC;
}
public void setTotalMoneyTC(String totalMoneyTC) {
TotalMoneyTC = totalMoneyTC;
}
public String getShipConfirmDate() {
return ShipConfirmDate;
}
public void setShipConfirmDate(String shipConfirmDate) {
ShipConfirmDate = shipConfirmDate;
}
public String getCrmProId() {
return crmProId;
}
public void setCrmProId(String crmProId) {
this.crmProId = crmProId;
}
public String getSalesOrderProductId() {
return salesOrderProductId;
}
public void setSalesOrderProductId(String salesOrderProductId) {
this.salesOrderProductId = salesOrderProductId;
}
public String getRowId() {
return rowId;
}
public void setRowId(String rowId) {
this.rowId = rowId;
}
public String getMainId() {
return mainId;
}
public void setMainId(String mainId) {
this.mainId = mainId;
}
public String getInvCode() {
return invCode;
}
public void setInvCode(String invCode) {
this.invCode = invCode;
}
public String getInvName() {
return invName;
}
public void setInvName(String invName) {
this.invName = invName;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public String getPricNum() {
return pricNum;
}
public void setPricNum(String pricNum) {
this.pricNum = pricNum;
}
public String getMeasCode() {
return measCode;
}
public void setMeasCode(String measCode) {
this.measCode = measCode;
}
public String getMeasName() {
return measName;
}
public void setMeasName(String measName) {
this.measName = measName;
}
public String getFinalPrice() {
return finalPrice;
}
public void setFinalPrice(String finalPrice) {
this.finalPrice = finalPrice;
}
public String getUntaxedAmount() {
return untaxedAmount;
}
public void setUntaxedAmount(String untaxedAmount) {
this.untaxedAmount = untaxedAmount;
}
public String getTaxAmount() {
return taxAmount;
}
public void setTaxAmount(String taxAmount) {
this.taxAmount = taxAmount;
}
public String getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(String totalPrice) {
this.totalPrice = totalPrice;
}
public String getTaxCombinationCode() {
return taxCombinationCode;
}
public void setTaxCombinationCode(String taxCombinationCode) {
this.taxCombinationCode = taxCombinationCode;
}
public String getTaxCombinationName() {
return taxCombinationName;
}
public void setTaxCombinationName(String taxCombinationName) {
this.taxCombinationName = taxCombinationName;
}
public String getStorageLocationCode() {
return storageLocationCode;
}
public void setStorageLocationCode(String storageLocationCode) {
this.storageLocationCode = storageLocationCode;
}
public String getStorageLocationName() {
return storageLocationName;
}
public void setStorageLocationName(String storageLocationName) {
this.storageLocationName = storageLocationName;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public String getPeriod() {
return period;
}
public void setPeriod(String period) {
this.period = period;
}
public String getExpiration() {
return expiration;
}
public void setExpiration(String expiration) {
this.expiration = expiration;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getCostAmount() {
return costAmount;
}
public void setCostAmount(String costAmount) {
this.costAmount = costAmount;
}
public String getWarehouseKeeperCode() {
return warehouseKeeperCode;
}
public void setWarehouseKeeperCode(String warehouseKeeperCode) {
this.warehouseKeeperCode = warehouseKeeperCode;
}
public String getWarehouseKeeperName() {
return warehouseKeeperName;
}
public void setWarehouseKeeperName(String warehouseKeeperName) {
this.warehouseKeeperName = warehouseKeeperName;
}
public String getWmsLocationCode() {
return wmsLocationCode;
}
public void setWmsLocationCode(String wmsLocationCode) {
this.wmsLocationCode = wmsLocationCode;
}
public String getWmsLocationName() {
return wmsLocationName;
}
public void setWmsLocationName(String wmsLocationName) {
this.wmsLocationName = wmsLocationName;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
}

View File

@ -0,0 +1,132 @@
<?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.u9c.saledeliver.dao.impl.VU9cSaledeliverDetailsDaoImpl">
<resultMap id="get-VU9cSaledeliverDetailsEntity-result" type="com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="rowId" column="row_id" jdbcType="VARCHAR"/>
<result property="mainId" column="main_id" jdbcType="VARCHAR"/>
<result property="invCode" column="inv_code" jdbcType="VARCHAR"/>
<result property="invName" column="inv_name" jdbcType="VARCHAR"/>
<result property="spec" column="spec" jdbcType="VARCHAR"/>
<result property="num" column="num" jdbcType="VARCHAR"/>
<result property="unitCode" column="unit_code" jdbcType="VARCHAR"/>
<result property="unitName" column="unit_name" jdbcType="VARCHAR"/>
<result property="pricNum" column="pric_num" jdbcType="VARCHAR"/>
<result property="measCode" column="meas_code" jdbcType="VARCHAR"/>
<result property="measName" column="meas_name" jdbcType="VARCHAR"/>
<result property="finalPrice" column="final_price" jdbcType="VARCHAR"/>
<result property="untaxedAmount" column="untaxed_amount" jdbcType="VARCHAR"/>
<result property="taxAmount" column="tax_amount" jdbcType="VARCHAR"/>
<result property="totalPrice" column="total_price" jdbcType="VARCHAR"/>
<result property="taxCombinationCode" column="tax_combination_code" jdbcType="VARCHAR"/>
<result property="taxCombinationName" column="tax_combination_name" jdbcType="VARCHAR"/>
<result property="storageLocationCode" column="storage_location_code" jdbcType="VARCHAR"/>
<result property="storageLocationName" column="storage_location_name" jdbcType="VARCHAR"/>
<result property="batch" column="batch" jdbcType="VARCHAR"/>
<result property="period" column="period" jdbcType="VARCHAR"/>
<result property="expiration" column="expiration" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
<result property="costAmount" column="cost_amount" jdbcType="VARCHAR"/>
<result property="warehouseKeeperCode" column="warehouse_keeper_code" jdbcType="VARCHAR"/>
<result property="warehouseKeeperName" column="warehouse_keeper_name" jdbcType="VARCHAR"/>
<result property="wmsLocationCode" column="wms_location_code" jdbcType="VARCHAR"/>
<result property="wmsLocationName" column="wms_location_name" jdbcType="VARCHAR"/>
<result property="deptCode" column="dept_code" jdbcType="VARCHAR"/>
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
<result property="salesOrderProductId" column="sales_order_product_id" jdbcType="VARCHAR"/>
<result property="crmProId" column="crm_pro_id" jdbcType="VARCHAR"/>
<result property="ShipConfirmDate" column="ShipConfirmDate" jdbcType="VARCHAR"/>
<result property="TotalNetMoneyTC" column="TotalNetMoneyTC" jdbcType="VARCHAR"/>
<result property="TotalMoneyTC" column="TotalMoneyTC" jdbcType="VARCHAR"/>
<result property="salesOrderId" column="sales_order_id" jdbcType="VARCHAR"/>
<result property="TotalMoneyTCNEW" column="TotalMoneyTCNEW" jdbcType="VARCHAR"/>
<result property="OrderByQtyTU" column="OrderByQtyTU" jdbcType="VARCHAR"/>
<result property="sales_order_id" column="salesOrderId" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cSaledeliverDetailsEntity_Base_Column_List">
row_id,
id,
sales_order_id,
ShipConfirmDate
,ROUND(TotalMoneyTC, 2)as TotalMoneyTC
,TotalMoneyTCNEW
,OrderByQtyTU
,main_id
,inv_code
,inv_name
,spec
,num
,unit_code
,unit_name
,pric_num
,meas_code
,crm_pro_id
,meas_name
,final_price
,untaxed_amount
,tax_amount
,total_price
,tax_combination_code
,tax_combination_name
,storage_location_code
,storage_location_name
,batch
,period
,expiration
,update_time
,cost_amount
,warehouse_keeper_code
,warehouse_keeper_name
,wms_location_code
,sales_order_product_id
,wms_location_name
,dept_code
,dept_name
</sql>
<!-- 查询 采用==查询 -->
<select id="VU9cSaledeliverDetailsEntity_list_base" resultMap="get-VU9cSaledeliverDetailsEntity-result" parameterType = "com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity">
select
<include refid="VU9cSaledeliverDetailsEntity_Base_Column_List" />
from v_u9c_saledeliver_details
<trim prefix="where" prefixOverrides="and">
<if test="rowId != null and rowId != ''"> and row_id = #{rowId} </if>
<if test="salesOrderId != null and salesOrderId != ''"> and so_id = #{salesOrderId} </if>
<if test="mainId != null and mainId != ''"> and main_id = #{mainId} </if>
<if test="invCode != null and invCode != ''"> and inv_code = #{invCode} </if>
<if test="invName != null and invName != ''"> and inv_name = #{invName} </if>
<if test="spec != null and spec != ''"> and spec = #{spec} </if>
<if test="num != null and num != ''"> and num = #{num} </if>
<if test="unitCode != null and unitCode != ''"> and unit_code = #{unitCode} </if>
<if test="unitName != null and unitName != ''"> and unit_name = #{unitName} </if>
<if test="pricNum != null and pricNum != ''"> and pric_num = #{pricNum} </if>
<if test="measCode != null and measCode != ''"> and meas_code = #{measCode} </if>
<if test="measName != null and measName != ''"> and meas_name = #{measName} </if>
<if test="finalPrice != null and finalPrice != ''"> and final_price = #{finalPrice} </if>
<if test="untaxedAmount != null and untaxedAmount != ''"> and untaxed_amount = #{untaxedAmount} </if>
<if test="taxAmount != null and taxAmount != ''"> and tax_amount = #{taxAmount} </if>
<if test="totalPrice != null and totalPrice != ''"> and total_price = #{totalPrice} </if>
<if test="taxCombinationCode != null and taxCombinationCode != ''"> and tax_combination_code = #{taxCombinationCode} </if>
<if test="taxCombinationName != null and taxCombinationName != ''"> and tax_combination_name = #{taxCombinationName} </if>
<if test="storageLocationCode != null and storageLocationCode != ''"> and storage_location_code = #{storageLocationCode} </if>
<if test="storageLocationName != null and storageLocationName != ''"> and storage_location_name = #{storageLocationName} </if>
<if test="batch != null and batch != ''"> and batch = #{batch} </if>
<if test="period != null and period != ''"> and period = #{period} </if>
<if test="expiration != null and expiration != ''"> and expiration = #{expiration} </if>
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
<if test="costAmount != null and costAmount != ''"> and cost_amount = #{costAmount} </if>
<if test="warehouseKeeperCode != null and warehouseKeeperCode != ''"> and warehouse_keeper_code = #{warehouseKeeperCode} </if>
<if test="warehouseKeeperName != null and warehouseKeeperName != ''"> and warehouse_keeper_name = #{warehouseKeeperName} </if>
<if test="wmsLocationCode != null and wmsLocationCode != ''"> and wms_location_code = #{wmsLocationCode} </if>
<if test="wmsLocationName != null and wmsLocationName != ''"> and wms_location_name = #{wmsLocationName} </if>
<if test="deptCode != null and deptCode != ''"> and dept_code = #{deptCode} </if>
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName} </if>
</trim>
</select>
</mapper>

View File

@ -0,0 +1,315 @@
package com.hzya.frame.u9c.saledeliver.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cSaledeliver)实体类
*
* @author makejava
* @since 2023-11-07 11:03:23
*/
public class VU9cSaledeliverEntity extends BaseEntity {
private String billType;
private String operateOrgName;
private String orgId;
private String billCode;
private String custName;
private String custCode;
private String orgCode;
private String billDate;
private String deptCode;
private String deptName;
private String salesmanCode;
private String salesmanName;
private String curCode;
private String curName;
private String shipmentTime;
private String isTax;
private String isDirect;
private String updatetime;
private String crmId;
private String operatorsId;
private String dataId;
private String salesOrderId;
private String soOrder;
private String SrcDocTransType;
private String TotalNetMoneyTC;
private String TotalMoneyTC;
private String address;
private String phone;
private String linkman;
private String state;
private String RcvQtyTU;
public String getRcvQtyTU() {
return RcvQtyTU;
}
public void setRcvQtyTU(String rcvQtyTU) {
RcvQtyTU = rcvQtyTU;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getLinkman() {
return linkman;
}
public void setLinkman(String linkman) {
this.linkman = linkman;
}
public String getTotalNetMoneyTC() {
return TotalNetMoneyTC;
}
public void setTotalNetMoneyTC(String totalNetMoneyTC) {
TotalNetMoneyTC = totalNetMoneyTC;
}
public String getTotalMoneyTC() {
return TotalMoneyTC;
}
public void setTotalMoneyTC(String totalMoneyTC) {
TotalMoneyTC = totalMoneyTC;
}
public String getSoOrder() {
return soOrder;
}
public void setSoOrder(String soOrder) {
this.soOrder = soOrder;
}
public String getSrcDocTransType() {
return SrcDocTransType;
}
public void setSrcDocTransType(String srcDocTransType) {
SrcDocTransType = srcDocTransType;
}
public String getSalesOrderId() {
return salesOrderId;
}
public void setSalesOrderId(String salesOrderId) {
this.salesOrderId = salesOrderId;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
public String getBillType() {
return billType;
}
public void setBillType(String billType) {
this.billType = billType;
}
public String getOperateOrgName() {
return operateOrgName;
}
public void setOperateOrgName(String operateOrgName) {
this.operateOrgName = operateOrgName;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getBillCode() {
return billCode;
}
public void setBillCode(String billCode) {
this.billCode = billCode;
}
public String getCustName() {
return custName;
}
public void setCustName(String custName) {
this.custName = custName;
}
public String getCustCode() {
return custCode;
}
public void setCustCode(String custCode) {
this.custCode = custCode;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getBillDate() {
return billDate;
}
public void setBillDate(String billDate) {
this.billDate = billDate;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getSalesmanCode() {
return salesmanCode;
}
public void setSalesmanCode(String salesmanCode) {
this.salesmanCode = salesmanCode;
}
public String getSalesmanName() {
return salesmanName;
}
public void setSalesmanName(String salesmanName) {
this.salesmanName = salesmanName;
}
public String getCurCode() {
return curCode;
}
public void setCurCode(String curCode) {
this.curCode = curCode;
}
public String getCurName() {
return curName;
}
public void setCurName(String curName) {
this.curName = curName;
}
public String getShipmentTime() {
return shipmentTime;
}
public void setShipmentTime(String shipmentTime) {
this.shipmentTime = shipmentTime;
}
public String getIsTax() {
return isTax;
}
public void setIsTax(String isTax) {
this.isTax = isTax;
}
public String getIsDirect() {
return isDirect;
}
public void setIsDirect(String isDirect) {
this.isDirect = isDirect;
}
public String getUpdatetime() {
return updatetime;
}
public void setUpdatetime(String updatetime) {
this.updatetime = updatetime;
}
public String getCrmId() {
return crmId;
}
public void setCrmId(String crmId) {
this.crmId = crmId;
}
public String getOperatorsId() {
return operatorsId;
}
public void setOperatorsId(String operatorsId) {
this.operatorsId = operatorsId;
}
}

View File

@ -0,0 +1,131 @@
<?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.u9c.saledeliver.dao.impl.VU9cSaledeliverEntityDaoImpl">
<resultMap id="get-VU9cSaledeliverEntity-result" type="com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity" >
<result property="billType" column="bill_type" jdbcType="VARCHAR"/>
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="operateOrgName" column="operate_org_name" jdbcType="VARCHAR"/>
<result property="orgId" column="org_id" jdbcType="VARCHAR"/>
<result property="billCode" column="bill_code" jdbcType="VARCHAR"/>
<result property="custName" column="cust_name" jdbcType="VARCHAR"/>
<result property="custCode" column="cust_code" jdbcType="VARCHAR"/>
<result property="orgCode" column="org_code" jdbcType="VARCHAR"/>
<result property="billDate" column="bill_date" jdbcType="VARCHAR"/>
<result property="deptCode" column="dept_code" jdbcType="VARCHAR"/>
<result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
<result property="salesmanCode" column="salesman_code" jdbcType="VARCHAR"/>
<result property="salesmanName" column="salesman_name" jdbcType="VARCHAR"/>
<result property="curCode" column="cur_code" jdbcType="VARCHAR"/>
<result property="curName" column="cur_name" jdbcType="VARCHAR"/>
<result property="shipmentTime" column="shipment_time" jdbcType="VARCHAR"/>
<result property="isTax" column="is_tax" jdbcType="VARCHAR"/>
<result property="isDirect" column="is_direct" jdbcType="VARCHAR"/>
<result property="updatetime" column="updateTime" jdbcType="VARCHAR"/>
<result property="crmId" column="crm_id" jdbcType="VARCHAR"/>
<result property="operatorsId" column="operators_id" jdbcType="VARCHAR"/>
<result property="salesOrderId" column="sales_order_id" jdbcType="VARCHAR"/>
<result property="SrcDocTransType" column="SrcDocTransType" jdbcType="VARCHAR"/>
<result property="soOrder" column="soOrder" jdbcType="VARCHAR"/>
<result property="TotalNetMoneyTC" column="TotalNetMoneyTC" jdbcType="VARCHAR"/>
<result property="TotalMoneyTC" column="TotalMoneyTC" jdbcType="VARCHAR"/>
<result property="address" column="address" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="linkman" column="linkman" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="RcvQtyTU" column="RcvQtyTU" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cSaledeliverEntity_Base_Column_List">
bill_type
,id
,TotalMoneyTC
,linkman
,phone
,address
,TotalNetMoneyTC
,soOrder
,operate_org_name
,org_id
,sales_order_id
,bill_code
,cust_name
,cust_code
,org_code
,bill_date
,dept_code
,dept_name
,salesman_code
,salesman_name
,cur_code
,cur_name
,shipment_time
,is_tax
,is_direct
,updateTime
,crm_id
,operators_id
</sql>
<!-- 查询 采用==查询 -->
<select id="VU9cSaledeliverEntity_list_base" resultMap="get-VU9cSaledeliverEntity-result" parameterType = "com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity">
select
<include refid="VU9cSaledeliverEntity_Base_Column_List" />
from v_u9c_saledeliver where (crm_id ='' or crm_id is null or updateTime > #{updatetime} )
<!--or updateTime > #{updatetime}-->
</select>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity" >
update SM_Ship set
<trim suffix="" suffixOverrides=",">
<if test="dataId != null and dataId != ''"> DescFlexField_PrivateDescSeg1 = #{dataId},</if>
</trim>
where id = #{id}
</update>
<!-- 查询 采用==查询 -->
<select id="VU9cSaledeliverEntity_list_base_for_delete" resultMap="get-VU9cSaledeliverEntity-result" parameterType = "com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity">
select
*
from SM_Ship_for_delete where (state is null or state ='') and crm_id !=''
</select>
<!--通过主键修改方法-->
<update id="entity_update_for_delete" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity" >
update SM_Ship_for_delete set state = #{state}
where id = #{id}
</update>
<!-- 查询 采用==查询 -->
<select id="VU9cSaledeliverEntity_list_base_for_update" resultMap="get-VU9cSaledeliverEntity-result" parameterType = "com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity">
select
-- Receivement.id as id,
rma.DescFlexField_PrivateDescSeg1 as crm_id
from PM_Receivement Receivement
left join PM_RcvLine RcvLine on Receivement.id = RcvLine.Receivement
left join SM_RMA rma on rma.id = RcvLine.srcdoc_srcdoc_entityid
where 1=1
and rma.DescFlexField_PrivateDescSeg1 != ''
and rma.DescFlexField_PrivateDescSeg1 is not null
and Receivement.Status = '5'
-- and rma.DescFlexField_PrivateDescSeg1 = '65dee663fe5e1f000159fd79'
and Receivement.ModifiedOn > #{updatetime}
GROUP BY rma.DescFlexField_PrivateDescSeg1
</select>
<!-- 查询 采用==查询 -->
<select id="VU9cSaledeliverEntity_list_base_for_update_details" resultMap="get-VU9cSaledeliverEntity-result" parameterType = "com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity">
select RcvQtyTU,crm_id from (
select
CAST(RcvLine.RcvQtyTU AS DECIMAL(20,4)) as RcvQtyTU,
rmaline.DescFlexField_PrivateDescSeg1 as crm_id,
RcvLine.Receivement,
rmaline.DescFlexField_PrivateDescSeg6
from PM_RcvLine RcvLine
left join SM_RMALine rmaline on RcvLine.srcdoc_srcdocline_entityid = rmaline.id
)m1
where DescFlexField_PrivateDescSeg6 = #{id}
</select>
</mapper>

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u9c.saledeliver.service;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (VU9cSaledeliverDetails)表服务接口
*
* @author makejava
* @since 2023-11-07 11:13:01
*/
public interface IVU9cSaledeliverDetailsService extends IBaseService<VU9cSaledeliverDetailsEntity, String>{
}

View File

@ -0,0 +1,37 @@
package com.hzya.frame.u9c.saledeliver.service;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (VU9cSaledeliver)表服务接口
*
* @author makejava
* @since 2023-10-26 11:29:52
*/
public interface IVU9cSaledeliverService extends IBaseService<VU9cSaledeliverEntity, String>{
/***
* @Content:获取U9C销售发货单数据
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date
* @Param
* @return
**/
String sendU9cSaledeliverToCRM();
/**
*
* @content 将删除的出货单同步删除CRM
* @author makejava
* @date 2024/1/10 0010 10:18
*
*/
void sendU9cSaledeliverToCRMOfDetele();
/**
*
* @content 将实际收货数量更新到CRM
* @author javaboy
* @date 2024/1/11 0011 9:34
*
*/
void sendU9cSaledeliverToCRMOfUpdate();
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.u9c.saledeliver.service.impl;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity;
import com.hzya.frame.u9c.saledeliver.dao.IVU9cSaledeliverDetailsDao;
import com.hzya.frame.u9c.saledeliver.service.IVU9cSaledeliverDetailsService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* (VU9cSaledeliverDetails)表服务实现类
*
* @author makejava
* @since 2023-11-07 11:13:02
*/
@Service("vU9cSaledeliverDetailsService")
public class VU9cSaledeliverDetailsServiceImpl extends BaseService<VU9cSaledeliverDetailsEntity, String> implements IVU9cSaledeliverDetailsService {
private IVU9cSaledeliverDetailsDao vU9cSaledeliverDetailsDao;
@Autowired
public void setVU9cSaledeliverDetailsDao(IVU9cSaledeliverDetailsDao dao) {
this.vU9cSaledeliverDetailsDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,335 @@
package com.hzya.frame.u9c.saledeliver.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.u9c.saledeliver.dao.IVU9cSaledeliverDetailsDao;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity;
import com.hzya.frame.u9c.saledeliver.dao.IVU9cSaledeliverDao;
import com.hzya.frame.u9c.saledeliver.service.IVU9cSaledeliverService;
import com.hzya.frame.u9c.util.CrmUtil;
import com.hzya.frame.web.exception.BaseSystemException;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* (VU9cSaledeliver)表服务实现类
*
* @author makejava
* @since 2023-10-26 11:29:53
*/
@Service("vU9cSaledeliverService")
public class VU9cSaledeliverServiceImpl extends BaseService<VU9cSaledeliverEntity, String> implements IVU9cSaledeliverService {
private IVU9cSaledeliverDao vU9cSaledeliverDao;
@Autowired
private IVU9cSaledeliverDetailsDao U9cSaledeliverDetailsDao;
@Autowired
public void setVU9cSaledeliverDao(IVU9cSaledeliverDao dao) {
this.vU9cSaledeliverDao = dao;
this.dao = dao;
}
//上一次同步时间
private String LAST_SYNCHRONISED_TIME = "";
private String LAST_SYNCHRONISED_TIME_UPDATE = "";
@Override
public String sendU9cSaledeliverToCRM() {
//获取待推送的U9c
VU9cSaledeliverEntity category = new VU9cSaledeliverEntity();
if (StrUtil.isBlank(LAST_SYNCHRONISED_TIME)) {
LAST_SYNCHRONISED_TIME = DateUtil.now();
}
//暂存时间
//暂存时间
String temp_time = LAST_SYNCHRONISED_TIME;
category.setUpdatetime(temp_time);
List<VU9cSaledeliverEntity> VU9cSaledeliverEntityList = vU9cSaledeliverDao.getu9cSaledeliver(category);
if(VU9cSaledeliverEntityList.size()>0){
for(VU9cSaledeliverEntity itemmaster : VU9cSaledeliverEntityList){
try {
LAST_SYNCHRONISED_TIME = DateUtil.now();
String crmId = itemmaster.getCrmId();
String permanentCode = itemmaster.getOperatorsId();
// String permanentCode = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
JSONObject tokenObj = CrmUtil.getToken(CrmUtil.MANAGERCODE);
//拼接传递参数
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键// todo 默认了操作员ID 等员工对接完成之后实际传入
main.put("duplicateCheck",true);
JSONObject data = new JSONObject();
JSONObject object_data = new JSONObject();
// object_data.put("name",itemmaster.getBillCode());//发货单编号
JSONArray ownerArr = new JSONArray();
ownerArr.add(permanentCode);
object_data.put("owner",ownerArr);//创建人
object_data.put("dataObjectApiName","DeliveryNoteObj");//接口名称
// object_data.put("sales_order_id",itemmaster.getSalesOrderId());//销售订单主键 //
object_data.put("field_W7k8T__c",itemmaster.getSrcDocTransType());// 来源单据类型
object_data.put("field_dp6ZV__c",itemmaster.getSoOrder()); //来源单据单号
object_data.put("field_6u2rk__c",itemmaster.getTotalMoneyTC()); //发货金额 --- 含税金额
object_data.put("field_5gwye__c",itemmaster.getBillCode()); //U9发货单号
object_data.put("field_J3s50__c",itemmaster.getAddress()); //收货联系地址
object_data.put("field_44TwV__c",itemmaster.getLinkman()); //收货联系人
object_data.put("field_s0L0r__c",itemmaster.getPhone()); //收货联系电话
if(StrUtil.isNotEmpty(crmId)){
object_data.put("_id",crmId); //发货单主键
}
String orgCode = itemmaster.getOrgCode();
String field_0alrS__c = "";
if(StrUtil.isNotEmpty(orgCode)){
switch (orgCode){
case "1001"://杭州恒华科技有限公司
field_0alrS__c = "cD2b3f";
break;
case "1002"://杭州华耀商贸有限公司
field_0alrS__c = "sl2qOPMpO";
break;
case "1004"://诚艺传递华耀
field_0alrS__c = "sl2qOPMpO";
break;
case "1003"://杭州胡记食品有限公司
field_0alrS__c = "eq8LyNWe1";
break;
default:
break;
}
}
object_data.put("field_0alrS__c",field_0alrS__c); //组织
//通过客户名称查询客户主键
String custName = itemmaster.getCustName();
String accountId = CrmUtil.getCustIdByCustName(custName,tokenObj.getString("corpAccessToken"),permanentCode,tokenObj.getString("corpId"));
object_data.put("account_id",accountId);//客户
object_data.put("field_1UjHy__c",itemmaster.getBillDate());//单据日期
String delivery_date = itemmaster.getShipmentTime();
if(StrUtil.isNotEmpty(delivery_date)){
object_data.put("delivery_date",com.hzya.frame.dateutil.DateUtil.dateStrToLong(itemmaster.getShipmentTime()));//发货日期
}
JSONObject details = new JSONObject();
data.put("object_data",object_data);
data.put("details",details);
//获取明细信息
VU9cSaledeliverDetailsEntity invDetails = new VU9cSaledeliverDetailsEntity();
invDetails.setSalesOrderId(itemmaster.getSalesOrderId());
invDetails.setMainId(itemmaster.getId());
List<VU9cSaledeliverDetailsEntity> invDetailsList = U9cSaledeliverDetailsDao.getu9cSaledeliverDetails(invDetails);
JSONArray deliveryNoteProduct = new JSONArray();
for(VU9cSaledeliverDetailsEntity d : invDetailsList){
JSONObject deliveryNoteProductObj = new JSONObject();
long _id = UUID.randomUUID().getMostSignificantBits();
deliveryNoteProductObj.put("_id",String.valueOf(_id));// 明细ID 自动生成
// deliveryNoteProductObj.put("_id",d.getId());// 明细ID 自动生成
deliveryNoteProductObj.put("field_Rc82I__c",d.getRowId());// 来源ID
deliveryNoteProductObj.put("sales_order_id",d.getSalesOrderId());// 销售订单主键
String supId = d.getCrmProId();
// String proId = CrmUtil.getProIdBySupId(supId,tokenObj.getString("corpAccessToken"),permanentCode,tokenObj.getString("corpId"));
deliveryNoteProductObj.put("product_id",supId);// 产品ID
deliveryNoteProductObj.put("field_Xjo2j__c",d.getStorageLocationName());//发货仓库
deliveryNoteProductObj.put("field_h9puj__c",d.getPeriod());//保质期
deliveryNoteProductObj.put("field_F6iOS__c",d.getBatch());//批号
deliveryNoteProductObj.put("sales_order_product_id",d.getSalesOrderProductId());// 订单产品主键CRM销售订单的行ID
deliveryNoteProductObj.put("delivery_num",d.getNum());// 发货数量
deliveryNoteProductObj.put("order_product_amount",d.getOrderByQtyTU());// 订单产品数量
String field_ci5By__c = d.getTotalMoneyTC();
if(StrUtil.isEmpty(d.getTotalMoneyTC()) || "0.0000".equals(d.getTotalMoneyTC())){
field_ci5By__c = "0";
// field_ci5By__c = "1111.0000";
}
deliveryNoteProductObj.put("field_ci5By__c",field_ci5By__c);// 发货金额
// deliveryNoteProductObj.put("field_ci5By__c","1.00");// 发货金额
String field_rz9y2__c = d.getShipConfirmDate();
if(StrUtil.isNotEmpty(field_rz9y2__c)){
// Date field_rz9y2__cDate = DateUtil.parse(field_rz9y2__c,"yyyy-MM-dd HH:mm:ss");
deliveryNoteProductObj.put("field_rz9y2__c", com.hzya.frame.dateutil.DateUtil.dateStrToLong(field_rz9y2__c));// 发货日期
}
deliveryNoteProduct.add(deliveryNoteProductObj);
}
details.put("DeliveryNoteProductObj",deliveryNoteProduct);
main.put("data",data);
String apiCode = "8000090003";
if(StrUtil.isEmpty(crmId)){
apiCode = "8000090003";
}else{
apiCode = "8000090015";
//如果想要修改CRM数据需要先解锁数据
String r = CrmUtil.unLockAndLock("8000090016","DeliveryNoteObj",crmId,tokenObj.getString("corpAccessToken"),CrmUtil.MANAGERCODE,tokenObj.getString("corpId"));
logger.info("发货单解锁"+r);
}
//推送数据到CRM进行新增或修改
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
//todo CRM傅佳敏提出 不管任何原因修改失败都需要再次锁定
if(StrUtil.isNotEmpty(crmId)){
//修改完数据之后需要再次锁定
String r = CrmUtil.unLockAndLock("8000090017","DeliveryNoteObj",crmId,tokenObj.getString("corpAccessToken"),CrmUtil.MANAGERCODE,tokenObj.getString("corpId"));
logger.info("发货单锁定"+r);
}
if(null != resultObj ){
String dataId = resultObj.getString("dataId");
String errorDescription = resultObj.getString("errorDescription");
if("success".equals(errorDescription)){
if(StrUtil.isNotEmpty(dataId)){
itemmaster.setDataId(dataId);
vU9cSaledeliverDao.updateCrmId(itemmaster);
}
}
}else{
LAST_SYNCHRONISED_TIME = DateUtil.now();
if(StrUtil.isEmpty(crmId)){
itemmaster.setDataId("系统错误,请联系管理员");
vU9cSaledeliverDao.updateCrmId(itemmaster);
}
new BaseSystemException("系统错误,请联系管理员");
}
logger.info("发货单返回信息:{}",resultObj);
} catch (Exception e) {
LAST_SYNCHRONISED_TIME = DateUtil.now();
logger.info("发货单错误,错误信息为:{}",e.getMessage());
logger.info("发货单错误,发货单信息为:{}",JSON.toJSONString(itemmaster));
e.printStackTrace();
}
}
}
return null;
}
/**
*
* @content 将删除的出货单同步删除CRM
* @author makejava
* @date 2024/1/10 0010 10:18
*
*/
@Override
public void sendU9cSaledeliverToCRMOfDetele() {
VU9cSaledeliverEntity category = new VU9cSaledeliverEntity();
List<VU9cSaledeliverEntity> VU9cSaledeliverEntityList = vU9cSaledeliverDao.getu9cSaledeliverForDelete(category);
if(null != VU9cSaledeliverEntityList && VU9cSaledeliverEntityList.size()>0){
for(VU9cSaledeliverEntity entity : VU9cSaledeliverEntityList){
String state = "2";
String permanentCode = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
JSONObject tokenObj = CrmUtil.getToken(CrmUtil.MANAGERCODE);
//拼接传递参数
try {
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键// todo 默认了操作员ID 等员工对接完成之后实际传入
main.put("duplicateCheck",true);
String crmId = entity.getCrmId();
if(StrUtil.isNotEmpty(crmId)){
JSONObject data = new JSONObject();
main.put("data",data);
data.put("object_data_id",crmId);
data.put("dataObjectApiName","DeliveryNoteObj");
state = "1";
String apiCode = "8000090018";
//发货单解锁
String r = CrmUtil.unLockAndLock("8000090016","DeliveryNoteObj",crmId,tokenObj.getString("corpAccessToken"),CrmUtil.MANAGERCODE,tokenObj.getString("corpId"));
logger.info("发货单解锁"+r);
//推送数据到CRM进行新增或修改
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
if(null != resultObj ){
String errorDescription = resultObj.getString("errorDescription");
if(!"success".equals(errorDescription)){
state = "2";
}
}else{
state = "2";
}
}
} finally {
//修改删除状态
entity.setState(state);
vU9cSaledeliverDao.updateDeleteState(entity);
}
}
}
}
/**
*
* @content 将实际收货数量更新到CRM
* @author javaboy
* @date 2024/1/11 0011 9:34
*
*/
@Override
public void sendU9cSaledeliverToCRMOfUpdate() {
//获取待推送的U9c
VU9cSaledeliverEntity category = new VU9cSaledeliverEntity();
if (StrUtil.isBlank(LAST_SYNCHRONISED_TIME_UPDATE)) {
LAST_SYNCHRONISED_TIME_UPDATE = DateUtil.now();
}
//暂存时间
String temp_time = LAST_SYNCHRONISED_TIME_UPDATE;
category.setUpdatetime(temp_time);
List<VU9cSaledeliverEntity> VU9cSaledeliverEntityList = vU9cSaledeliverDao.getu9cSaledeliverForUpdate(category);
if(VU9cSaledeliverEntityList.size()>0) {
for (VU9cSaledeliverEntity itemmaster : VU9cSaledeliverEntityList) {
LAST_SYNCHRONISED_TIME_UPDATE = DateUtil.now();
try {
String permanentCode = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
JSONObject tokenObj = CrmUtil.getToken(CrmUtil.MANAGERCODE);
//拼接传递参数
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键// todo 默认了操作员ID 等员工对接完成之后实际传入
JSONObject data = new JSONObject();
JSONObject object_data = new JSONObject();
String id = itemmaster.getCrmId();
object_data.put("_id",id);
object_data.put("dataObjectApiName","ReturnedGoodsInvoiceObj");
//获取明细数据并组装数据
VU9cSaledeliverEntity deteils = new VU9cSaledeliverEntity();
deteils.setId(id);
JSONObject detailsObj = new JSONObject();
JSONArray ReturnedGoodsInvoiceProductObj = new JSONArray();
List<VU9cSaledeliverEntity> VU9cSaledeliverEntityDetailsList = vU9cSaledeliverDao.getu9cSaledeliverForUpdateDetails(deteils);
if(VU9cSaledeliverEntityDetailsList.size()>0){
for(VU9cSaledeliverEntity VU9cSaledeliverEntityDetails : VU9cSaledeliverEntityDetailsList){
JSONObject body = new JSONObject();
String _id = VU9cSaledeliverEntityDetails.getCrmId();
String RcvQtyTU = VU9cSaledeliverEntityDetails.getRcvQtyTU();
body.put("_id",_id);
body.put("field_HE24V__c",RcvQtyTU);
ReturnedGoodsInvoiceProductObj.add(body);
}
}else{
//如果没有明细信息跳过当前循环
continue;
}
detailsObj.put("ReturnedGoodsInvoiceProductObj",ReturnedGoodsInvoiceProductObj);
data.put("object_data",object_data);
main.put("data",data);
data.put("details",detailsObj);
String apiCode = "8000090020";
//退货单解锁
String unLockAndLock = CrmUtil.unLockAndLock("8000090016","ReturnedGoodsInvoiceObj",itemmaster.getCrmId(),tokenObj.getString("corpAccessToken"),CrmUtil.MANAGERCODE,tokenObj.getString("corpId"));
logger.info("退货单解锁"+unLockAndLock);
//推送数据到CRM修改
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
//退货单锁定
String r = CrmUtil.unLockAndLock("8000090017","ReturnedGoodsInvoiceObj",itemmaster.getCrmId(),tokenObj.getString("corpAccessToken"),CrmUtil.MANAGERCODE,tokenObj.getString("corpId"));
logger.info("退货单锁定"+r);
} catch (Exception e) {
LAST_SYNCHRONISED_TIME_UPDATE = DateUtil.now();
logger.info("退货单更新异常,错误信息为:{}",JSON.toJSONString(itemmaster));
e.printStackTrace();
}
}
}
}
}

View File

@ -0,0 +1,50 @@
package com.hzya.frame.u9c.salereceiver.dao;
import com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (view:v_u9c_salereceiver)表数据库访问层
*
* @author makejava
* @since 2023-10-26 11:32:02
*/
public interface IVU9cSalereceiverDao extends IBaseDao<VU9cSalereceiverEntity, String> {
/***
* @Content:获取U9C销售收款单数据
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日13:56:28
* @Param
* @return
**/
List<VU9cSalereceiverEntity> getu9cSalereceiver(VU9cSalereceiverEntity category);
/***
* @Content:修改U9C状态
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日13:56:28
* @Param
* @return
**/
int updateState(VU9cSalereceiverEntity itemmaster);
/**
*
* @content 查询应收单触发器生成的临时表
* @author makejava
* @date 2024/1/10 0010 14:41
*
*/
List<VU9cSalereceiverEntity> getu9cSalereceiverForDelete(VU9cSalereceiverEntity category);
/**
*
* @content 更新触发器生成的临时表修改状态
* @author makejava
* @date 2024/1/10 0010 14:43
*
*/
int updateStateForDelete(VU9cSalereceiverEntity itemmaster);
}

View File

@ -0,0 +1,32 @@
package com.hzya.frame.u9c.salereceiver.dao;
import com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverDetailsEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (view:v_u9c_salereceiver_details)表数据库访问层
*
* @author makejava
* @since 2023-11-09 14:49:35
*/
public interface IVU9cSalereceiverDetailsDao extends IBaseDao<VU9cSalereceiverDetailsEntity, String> {
/***
* @Content:通过主表ID获取当前明细信息
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年11月9日15:07:08
* @Param
* @return
**/
List<VU9cSalereceiverDetailsEntity> getu9cSalereceiverDetails(VU9cSalereceiverDetailsEntity details);
/***
* @Content:修改应收单明细信息
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年11月9日15:13:56
* @Param
* @return
**/
int updateState(VU9cSalereceiverDetailsEntity d);
}

View File

@ -0,0 +1,40 @@
package com.hzya.frame.u9c.salereceiver.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity;
import com.hzya.frame.u9c.salereceiver.dao.IVU9cSalereceiverDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (VU9cSalereceiver)表数据库访问层
*
* @author makejava
* @since 2023-10-26 11:32:06
*/
@Repository("VU9cSalereceiverDaoImpl")
public class VU9cSalereceiverDaoImpl extends MybatisGenericDao<VU9cSalereceiverEntity, String> implements IVU9cSalereceiverDao{
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cSalereceiverEntity> getu9cSalereceiver(VU9cSalereceiverEntity category) {
return (List<VU9cSalereceiverEntity>) super.selectList("com.hzya.frame.u9c.salereceiver.dao.impl.VU9cSalereceiverEntityDaoImpl.VU9cSalereceiverEntity_list_base",category);
}
@DS("henghua_sqlserver_test_xel")
@Override
public int updateState(VU9cSalereceiverEntity itemmaster) {
return super.update("com.hzya.frame.u9c.salereceiver.dao.impl.VU9cSalereceiverEntityDaoImpl.VU9cSalereceiverEntity_update",itemmaster);
}
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cSalereceiverEntity> getu9cSalereceiverForDelete(VU9cSalereceiverEntity category) {
return (List<VU9cSalereceiverEntity>) super.selectList("com.hzya.frame.u9c.salereceiver.dao.impl.VU9cSalereceiverEntityDaoImpl.VU9cSalereceiverEntity_list_base_for_delete",category);
}
@DS("henghua_sqlserver_test_xel")
@Override
public int updateStateForDelete(VU9cSalereceiverEntity itemmaster) {
return super.update("com.hzya.frame.u9c.salereceiver.dao.impl.VU9cSalereceiverEntityDaoImpl.VU9cSalereceiverEntity_update_for_delete",itemmaster);
}
}

View File

@ -0,0 +1,30 @@
package com.hzya.frame.u9c.salereceiver.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverDetailsEntity;
import com.hzya.frame.u9c.salereceiver.dao.IVU9cSalereceiverDetailsDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (VU9cSalereceiverDetails)表数据库访问层
*
* @author makejava
* @since 2023-11-09 14:49:41
*/
@Repository("VU9cSalereceiverDetailsDaoImpl")
public class VU9cSalereceiverDetailsDaoImpl extends MybatisGenericDao<VU9cSalereceiverDetailsEntity, String> implements IVU9cSalereceiverDetailsDao{
@DS("henghua_sqlserver_test_xel")
@Override
public List<VU9cSalereceiverDetailsEntity> getu9cSalereceiverDetails(VU9cSalereceiverDetailsEntity details) {
return (List<VU9cSalereceiverDetailsEntity>) super.selectList("com.hzya.frame.u9c.salereceiver.dao.impl.VU9cSalereceiverDetailsEntityDaoImpl.VU9cSalereceiverDetailsEntity_list_base",details);
}
@DS("henghua_sqlserver_test_xel")
@Override
public int updateState(VU9cSalereceiverDetailsEntity d) {
return super.update("com.hzya.frame.u9c.salereceiver.dao.impl.VU9cSalereceiverDetailsEntityDaoImpl.VU9cSalereceiverDetailsEntity_update",d);
}
}

View File

@ -0,0 +1,236 @@
package com.hzya.frame.u9c.salereceiver.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cSalereceiverDetails)实体类
*
* @author makejava
* @since 2023-11-09 14:44:58
*/
public class VU9cSalereceiverDetailsEntity extends BaseEntity {
private String state;
private String num;
private String orgId;
private String invCode;
private String invName;
private String mainId;
private String money;
private String mainOrgCode;
private String mainOrgName;
private String proId;
private String dataId;
private String deliverBillId;
private String TaxPrice;
private String NonTaxPrice;
private String CfmedARGoodsTax_OCMoney;
private String TaxPriceSum;
private String sRowId;
private String rmaMoney;
private String soId;
private String billType;
private String rmaLine;
private String rmaId;
private String DocLineNo;
public String getDocLineNo() {
return DocLineNo;
}
public void setDocLineNo(String docLineNo) {
DocLineNo = docLineNo;
}
public String getRmaId() {
return rmaId;
}
public void setRmaId(String rmaId) {
this.rmaId = rmaId;
}
public String getRmaLine() {
return rmaLine;
}
public void setRmaLine(String rmaLine) {
this.rmaLine = rmaLine;
}
public String getRmaMoney() {
return rmaMoney;
}
public void setRmaMoney(String rmaMoney) {
this.rmaMoney = rmaMoney;
}
public String getSoId() {
return soId;
}
public void setSoId(String soId) {
this.soId = soId;
}
public String getBillType() {
return billType;
}
public void setBillType(String billType) {
this.billType = billType;
}
public String getsRowId() {
return sRowId;
}
public void setsRowId(String sRowId) {
this.sRowId = sRowId;
}
public String getTaxPrice() {
return TaxPrice;
}
public void setTaxPrice(String taxPrice) {
TaxPrice = taxPrice;
}
public String getNonTaxPrice() {
return NonTaxPrice;
}
public void setNonTaxPrice(String nonTaxPrice) {
NonTaxPrice = nonTaxPrice;
}
public String getCfmedARGoodsTax_OCMoney() {
return CfmedARGoodsTax_OCMoney;
}
public void setCfmedARGoodsTax_OCMoney(String cfmedARGoodsTax_OCMoney) {
CfmedARGoodsTax_OCMoney = cfmedARGoodsTax_OCMoney;
}
public String getTaxPriceSum() {
return TaxPriceSum;
}
public void setTaxPriceSum(String taxPriceSum) {
TaxPriceSum = taxPriceSum;
}
public String getDeliverBillId() {
return deliverBillId;
}
public void setDeliverBillId(String deliverBillId) {
this.deliverBillId = deliverBillId;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getInvCode() {
return invCode;
}
public void setInvCode(String invCode) {
this.invCode = invCode;
}
public String getInvName() {
return invName;
}
public void setInvName(String invName) {
this.invName = invName;
}
public String getMainId() {
return mainId;
}
public void setMainId(String mainId) {
this.mainId = mainId;
}
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
public String getMainOrgCode() {
return mainOrgCode;
}
public void setMainOrgCode(String mainOrgCode) {
this.mainOrgCode = mainOrgCode;
}
public String getMainOrgName() {
return mainOrgName;
}
public void setMainOrgName(String mainOrgName) {
this.mainOrgName = mainOrgName;
}
public String getProId() {
return proId;
}
public void setProId(String proId) {
this.proId = proId;
}
}

View File

@ -0,0 +1,70 @@
<?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.u9c.salereceiver.dao.impl.VU9cSalereceiverDetailsEntityDaoImpl">
<resultMap id="get-VU9cSalereceiverDetailsEntity-result" type="com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverDetailsEntity" >
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="id" column="ID" jdbcType="VARCHAR"/>
<result property="num" column="num" jdbcType="VARCHAR"/>
<result property="orgId" column="org_id" jdbcType="VARCHAR"/>
<result property="invCode" column="inv_code" jdbcType="VARCHAR"/>
<result property="invName" column="inv_name" jdbcType="VARCHAR"/>
<result property="mainId" column="main_id" jdbcType="VARCHAR"/>
<result property="money" column="money" jdbcType="VARCHAR"/>
<result property="mainOrgCode" column="main_org_code" jdbcType="VARCHAR"/>
<result property="mainOrgName" column="main_org_name" jdbcType="VARCHAR"/>
<result property="proId" column="pro_id" jdbcType="VARCHAR"/>
<result property="TaxPrice" column="TaxPrice" jdbcType="VARCHAR"/>
<result property="NonTaxPrice" column="NonTaxPrice" jdbcType="VARCHAR"/>
<result property="CfmedARGoodsTax_OCMoney" column="CfmedARGoodsTax_OCMoney" jdbcType="VARCHAR"/>
<result property="TaxPriceSum" column="TaxPriceSum" jdbcType="VARCHAR"/>
<result property="sRowId" column="s_row_id" jdbcType="VARCHAR"/>
<result property="deliverBillId" column="deliverBillId" jdbcType="VARCHAR"/>
<result property="rmaId" column="rma_id" jdbcType="VARCHAR"/>
<result property="rmaLine" column="rma_line" jdbcType="VARCHAR"/>
<result property="billType" column="bill_type" jdbcType="VARCHAR"/>
<result property="soId" column="so_id" jdbcType="VARCHAR"/>
<result property="rmaMoney" column="rma_money" jdbcType="VARCHAR"/>
<result property="DocLineNo" column="DocLineNo" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cSalereceiverDetailsEntity_Base_Column_List">
state
,s_row_id
,deliverBillId
,TaxPrice
,CfmedARGoodsTax_OCMoney
,TaxPriceSum
,ID
,num
,org_id
,inv_code
,inv_name
,main_id
,money
,main_org_code
,main_org_name
,pro_id
</sql>
<!-- 查询 采用==查询 -->
<select id="VU9cSalereceiverDetailsEntity_list_base" resultMap="get-VU9cSalereceiverDetailsEntity-result" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverDetailsEntity">
select
*
from v_u9c_salereceiver_details
where main_id = #{mainId}
</select>
<!--通过主键修改方法-->
<update id="VU9cSalereceiverDetailsEntity_update" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverDetailsEntity" >
update AR_ARBillLine set
<trim suffix="" suffixOverrides=",">
<if test="dataId != null and dataId != ''"> DescFlexField_PrivateDescSeg1 = #{dataId},</if>
</trim>
where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,272 @@
package com.hzya.frame.u9c.salereceiver.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cSalereceiver)实体类
*
* @author makejava
* @since 2023-11-09 14:44:10
*/
public class VU9cSalereceiverEntity extends BaseEntity {
private String orgId;
private String soId;
private String orgCode;
private String billCode;
private String custCode;
private String custName;
private String custAddsCode;
private String custAddsName;
private String accountPursuantCode;
private String accountPursuantName;
private String curCode;
private String cur;
private String accountDate;
private String accountPeriodName;
private String accountPeriodCode;
private String billTypeCode;
private String billTypeName;
private String sourceBillCode;
private String sourceBillType;
private String price;
private String state;
private String crmId;
private String saleId;
private String operatorsId;
private String dataId;
private String updateTime;
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getSoId() {
return soId;
}
public void setSoId(String soId) {
this.soId = soId;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getBillCode() {
return billCode;
}
public void setBillCode(String billCode) {
this.billCode = billCode;
}
public String getCustCode() {
return custCode;
}
public void setCustCode(String custCode) {
this.custCode = custCode;
}
public String getCustName() {
return custName;
}
public void setCustName(String custName) {
this.custName = custName;
}
public String getCustAddsCode() {
return custAddsCode;
}
public void setCustAddsCode(String custAddsCode) {
this.custAddsCode = custAddsCode;
}
public String getCustAddsName() {
return custAddsName;
}
public void setCustAddsName(String custAddsName) {
this.custAddsName = custAddsName;
}
public String getAccountPursuantCode() {
return accountPursuantCode;
}
public void setAccountPursuantCode(String accountPursuantCode) {
this.accountPursuantCode = accountPursuantCode;
}
public String getAccountPursuantName() {
return accountPursuantName;
}
public void setAccountPursuantName(String accountPursuantName) {
this.accountPursuantName = accountPursuantName;
}
public String getCurCode() {
return curCode;
}
public void setCurCode(String curCode) {
this.curCode = curCode;
}
public String getCur() {
return cur;
}
public void setCur(String cur) {
this.cur = cur;
}
public String getAccountDate() {
return accountDate;
}
public void setAccountDate(String accountDate) {
this.accountDate = accountDate;
}
public String getAccountPeriodName() {
return accountPeriodName;
}
public void setAccountPeriodName(String accountPeriodName) {
this.accountPeriodName = accountPeriodName;
}
public String getAccountPeriodCode() {
return accountPeriodCode;
}
public void setAccountPeriodCode(String accountPeriodCode) {
this.accountPeriodCode = accountPeriodCode;
}
public String getBillTypeCode() {
return billTypeCode;
}
public void setBillTypeCode(String billTypeCode) {
this.billTypeCode = billTypeCode;
}
public String getBillTypeName() {
return billTypeName;
}
public void setBillTypeName(String billTypeName) {
this.billTypeName = billTypeName;
}
public String getSourceBillCode() {
return sourceBillCode;
}
public void setSourceBillCode(String sourceBillCode) {
this.sourceBillCode = sourceBillCode;
}
public String getSourceBillType() {
return sourceBillType;
}
public void setSourceBillType(String sourceBillType) {
this.sourceBillType = sourceBillType;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCrmId() {
return crmId;
}
public void setCrmId(String crmId) {
this.crmId = crmId;
}
public String getSaleId() {
return saleId;
}
public void setSaleId(String saleId) {
this.saleId = saleId;
}
public String getOperatorsId() {
return operatorsId;
}
public void setOperatorsId(String operatorsId) {
this.operatorsId = operatorsId;
}
}

View File

@ -0,0 +1,93 @@
<?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.u9c.salereceiver.dao.impl.VU9cSalereceiverEntityDaoImpl">
<resultMap id="get-VU9cSalereceiverEntity-result" type="com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity" >
<result property="orgId" column="org_id" jdbcType="VARCHAR"/>
<result property="id" column="ID" jdbcType="VARCHAR"/>
<result property="orgCode" column="org_code" jdbcType="VARCHAR"/>
<result property="billCode" column="bill_code" jdbcType="VARCHAR"/>
<result property="custCode" column="cust_code" jdbcType="VARCHAR"/>
<result property="custName" column="cust_name" jdbcType="VARCHAR"/>
<result property="custAddsCode" column="cust_adds_code" jdbcType="VARCHAR"/>
<result property="custAddsName" column="cust_adds_name" jdbcType="VARCHAR"/>
<result property="accountPursuantCode" column="account_pursuant_code" jdbcType="VARCHAR"/>
<result property="accountPursuantName" column="account_pursuant_name" jdbcType="VARCHAR"/>
<result property="curCode" column="cur_code" jdbcType="VARCHAR"/>
<result property="cur" column="cur" jdbcType="VARCHAR"/>
<result property="accountDate" column="account_date" jdbcType="VARCHAR"/>
<result property="accountPeriodName" column="account_period_name" jdbcType="VARCHAR"/>
<result property="accountPeriodCode" column="account_period_code" jdbcType="VARCHAR"/>
<result property="billTypeCode" column="bill_type_code" jdbcType="VARCHAR"/>
<result property="billTypeName" column="bill_type_name" jdbcType="VARCHAR"/>
<result property="sourceBillCode" column="source_bill_code" jdbcType="VARCHAR"/>
<result property="sourceBillType" column="source_bill_type" jdbcType="VARCHAR"/>
<result property="price" column="price" jdbcType="VARCHAR"/>
<result property="state" column="state" jdbcType="VARCHAR"/>
<result property="crmId" column="crm_id" jdbcType="VARCHAR"/>
<result property="saleId" column="sale_id" jdbcType="VARCHAR"/>
<result property="operatorsId" column="operators_id" jdbcType="VARCHAR"/>
<result property="soId" column="soId" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cSalereceiverEntity_Base_Column_List">
org_id
,ID
,org_code
,bill_code
,cust_code
,cust_name
,cust_adds_code
,cust_adds_name
,account_pursuant_code
,account_pursuant_name
,cur_code
,cur
,account_date
,account_period_name
,account_period_code
,bill_type_code
,bill_type_name
,source_bill_code
,source_bill_type
,price
,state
,crm_id
,sale_id
,soId
,operators_id
</sql>
<!-- 查询 采用==查询 -->
<select id="VU9cSalereceiverEntity_list_base" resultMap="get-VU9cSalereceiverEntity-result" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity">
select
*
from v_u9c_salereceiver
where (crm_id ='' or crm_id is null or update_time > #{updateTime} )
</select>
<!--通过主键修改方法-->
<update id="VU9cSalereceiverEntity_update" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity" >
update AR_ARBillHead set
<trim suffix="" suffixOverrides=",">
<if test="dataId != null and dataId != ''"> DescFlexField_PrivateDescSeg1 = #{dataId},</if>
</trim>
where id = #{id}
</update>
<!-- 查询 采用==查询 -->
<select id="VU9cSalereceiverEntity_list_base_for_delete" resultMap="get-VU9cSalereceiverEntity-result" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity">
select
*
from AR_ARBillHead_for_delete where (state is null or state ='') and crm_id !=''
</select>
<!--通过主键修改方法-->
<update id="VU9cSalereceiverEntity_update_for_delete" parameterType = "com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity" >
update AR_ARBillHead_for_delete set state = #{state}
where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,29 @@
package com.hzya.frame.u9c.salereceiver.service;
import com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (VU9cSalereceiver)表服务接口
*
* @author makejava
* @since 2023-10-26 11:32:08
*/
public interface IVU9cSalereceiverService extends IBaseService<VU9cSalereceiverEntity, String>{
/***
* @Content:获取U9C销售收款单数据
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日13:52:41
* @Param
* @return
**/
String sendU9cSalereceiverToCRM();
/**
*
* @content 将删除的应收单同步删除CRM单据
* @author makejava
* @date 2024/1/10 0010 14:38
*
*/
void sendU9cSalereceiverToCRMOfDetele();
}

View File

@ -0,0 +1,338 @@
package com.hzya.frame.u9c.salereceiver.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverEntity;
import com.hzya.frame.u9c.saledeliver.service.IVU9cSaledeliverService;
import com.hzya.frame.u9c.salereceiver.dao.IVU9cSalereceiverDetailsDao;
import com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverDetailsEntity;
import com.hzya.frame.u9c.salereceiver.entity.VU9cSalereceiverEntity;
import com.hzya.frame.u9c.salereceiver.dao.IVU9cSalereceiverDao;
import com.hzya.frame.u9c.salereceiver.service.IVU9cSalereceiverService;
import com.hzya.frame.u9c.util.CrmUtil;
import com.hzya.frame.u9c.warehouse.service.IVU9cWarehouseService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* (VU9cSalereceiver)表服务实现类
*
* @author makejava
* @since 2023-10-26 11:32:09
*/
@Service("vU9cSalereceiverService")
public class VU9cSalereceiverServiceImpl extends BaseService<VU9cSalereceiverEntity, String> implements IVU9cSalereceiverService {
private IVU9cSalereceiverDao vU9cSalereceiverDao;
@Autowired
private IVU9cSaledeliverService v9cSaledeliverService;
@Autowired
private IVU9cSalereceiverDetailsDao u9cSalereceiverDetailsDao;
@Autowired
public void setVU9cSalereceiverDao(IVU9cSalereceiverDao dao) {
this.vU9cSalereceiverDao = dao;
this.dao = dao;
}
//上一次同步时间
private String LAST_SYNCHRONISED_TIME = "";
@Override
public String sendU9cSalereceiverToCRM() {
//获取待推送的U9c
VU9cSalereceiverEntity category = new VU9cSalereceiverEntity();
if (StrUtil.isBlank(LAST_SYNCHRONISED_TIME)) {
LAST_SYNCHRONISED_TIME = DateUtil.now();
}
//暂存时间
String temp_time = LAST_SYNCHRONISED_TIME;
category.setUpdateTime(temp_time);
List<VU9cSalereceiverEntity> VU9cSalereceiverEntityList = vU9cSalereceiverDao.getu9cSalereceiver(category);
if(VU9cSalereceiverEntityList.size()>0){
for(VU9cSalereceiverEntity itemmaster : VU9cSalereceiverEntityList){
LAST_SYNCHRONISED_TIME = DateUtil.now();
//因纷享销客接口性质不同 表头表体分开传递则机型分开推送
// String permanentCode = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
String permanentCode =itemmaster.getOperatorsId();
JSONObject tokenObj = CrmUtil.getToken(permanentCode);
//推送表头信息
String dataId = sendSalereceiverMain(itemmaster, permanentCode, tokenObj);
// String id = itemmaster.getId();
// String billCode = itemmaster.getBillCode();
//查询明细信息并推送
// sendSalereceiverDetails(id, permanentCode, tokenObj,billCode,dataId);
}
}
return null;
}
/**
*
* @content 将删除的应收单同步删除CRM单据
* @author makejava
* @date 2024/1/10 0010 14:38
*
*/
@Override
public void sendU9cSalereceiverToCRMOfDetele() {
VU9cSalereceiverEntity category = new VU9cSalereceiverEntity();
List<VU9cSalereceiverEntity> VU9cSalereceiverEntityList = vU9cSalereceiverDao.getu9cSalereceiverForDelete(category);
if(null != VU9cSalereceiverEntityList && VU9cSalereceiverEntityList.size()>0){
for(VU9cSalereceiverEntity entity : VU9cSalereceiverEntityList){
String state = "2";
String permanentCode = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
JSONObject tokenObj = CrmUtil.getToken(CrmUtil.MANAGERCODE);
//拼接传递参数
try {
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键// todo 默认了操作员ID 等员工对接完成之后实际传入
main.put("duplicateCheck",true);
String crmId = entity.getCrmId();
if(StrUtil.isNotEmpty(crmId)){
JSONObject data = new JSONObject();
main.put("data",data);
data.put("object_data_id",crmId);
data.put("dataObjectApiName","object_ab2ol__c");
state = "1";
String apiCode = "8000090019";
//回款单解锁
String r = CrmUtil.unLockAndLock("8000090016","object_ab2ol__c",crmId,tokenObj.getString("corpAccessToken"),CrmUtil.MANAGERCODE,tokenObj.getString("corpId"));
//推送数据到CRM进行新增或修改
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
if(null != resultObj ){
String errorDescription = resultObj.getString("errorDescription");
if(!"success".equals(errorDescription)){
state = "2";
}
}else{
state = "2";
}
}
} finally {
//修改删除状态
entity.setState(state);
vU9cSalereceiverDao.updateStateForDelete(entity);
}
}
}
}
private void sendSalereceiverDetails(String mainId, String permanentCode, JSONObject tokenObj,String billCode,String dataId) {
VU9cSalereceiverDetailsEntity details = new VU9cSalereceiverDetailsEntity();
details.setMainId(mainId);
List<VU9cSalereceiverDetailsEntity> detailsList = u9cSalereceiverDetailsDao.getu9cSalereceiverDetails(details);
if(null != detailsList && detailsList.size()>0){
for(VU9cSalereceiverDetailsEntity d : detailsList){
String id = d.getId();
//拼接传递参数
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
main.put("duplicateCheck",true);
JSONObject data = new JSONObject();
main.put("data",data);
JSONObject object_data = new JSONObject();
JSONArray owner = new JSONArray();
owner.add(permanentCode);
object_data.put("dataObjectApiName","object_1n255__c");
object_data.put("owner",owner);
// object_data.put("field_q18s0__c","6549e908e6767b0001fe6a68");//todo 等待对接发货单号主键
object_data.put("field_q18s0__c",d.getDeliverBillId());//todo 等待对接发货单号主键
object_data.put("field_126Mr__c",dataId);// CRM表头主键
object_data.put("field_8v8Np__c",d.getInvName());// 产品名称
object_data.put("field_hog9b__c",d.getNum());// 数量
object_data.put("field_bumZ5__c",d.getTaxPrice());// 单价
object_data.put("field_oZ129__c","");// 回款方式
object_data.put("field_Tt1kg__c",d.getTaxPriceSum());// 金额
object_data.put("field_e3NWX__c","");// 备注
object_data.put("field_y67ja__c",billCode);// 回款单编号
object_data.put("field_4gcxj__c",d.getsRowId());// 发货单明细行号
object_data.put("field_0dmOD__c",d.getProId());// 产品ID
object_data.put("field_0I0C5__c",d.getRmaMoney());// 本次退款金额
object_data.put("field_Fl2r5__c",d.getRmaLine());// 退货单金额
object_data.put("field_6gfrJ__c",d.getRmaId());// 退货单ID
object_data.put("field_j8Kdx__c",d.getSoId());// 销售订单ID
object_data.put("field_vE2T3__c",d.getDocLineNo());//发货单行号
String billType = d.getBillType();
String record_type = "";
if("退回".equals(billType)){
record_type = "record_EjW1M__c";
}
if("出货".equals(billType)){
record_type = "default__c";
}
object_data.put("record_type",record_type);// 业务类型
data.put("object_data",object_data);
String apiCode = "8000090012";
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
try {
String errorDescription = resultObj.getString("errorDescription");
if("success".equals(errorDescription)){
String dataIdDetails = resultObj.getString("dataId");
if(StrUtil.isNotEmpty(dataIdDetails)){
d.setDataId(dataIdDetails);
u9cSalereceiverDetailsDao.updateState(d);
}
}
} catch (Exception e) {
d.setDataId("系统异常,请联系管理员");
u9cSalereceiverDetailsDao.updateState(d);
e.printStackTrace();
}
logger.info("CRM应收单明细返回信息"+resultObj);
}
}
}
/***
* @Content:推送表头信息
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年11月9日15:03:19
* @Param
* @return
**/
private String sendSalereceiverMain(VU9cSalereceiverEntity itemmaster, String permanentCode, JSONObject tokenObj) {
String id = itemmaster.getId();
String dataId = null;
JSONObject resultObj = new JSONObject();
try {
//拼接传递参数
String crmId = itemmaster.getCrmId();
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
main.put("triggerWorkFlow",true);//是否触发流程不需要
main.put("includeDetailIds",true);
JSONObject data = new JSONObject();
main.put("data",data);
JSONObject object_data = new JSONObject();
JSONArray owner = new JSONArray();
owner.add(permanentCode);
object_data.put("dataObjectApiName","object_ab2ol__c");
object_data.put("owner",owner);
String custName = itemmaster.getCustName();
String custId = CrmUtil.getCustIdByCustName(custName,tokenObj.getString("corpAccessToken"),permanentCode,tokenObj.getString("corpId"));
object_data.put("field_e0335__c",custId);//客户名称
// object_data.put("field_c4r1p__c",itemmaster.getSoId());// CRM销售订单主键
object_data.put("field_l3g1v__c",itemmaster.getBillCode());//U9C回款编号
// object_data.put("field_l3g1v__c",itemmaster.getBillCode());//U9C回款编号
String orgCode = itemmaster.getOrgCode();
//如果CRMID存在则走修改流程
if(StrUtil.isNotEmpty(crmId)){
object_data.put("_id",itemmaster.getCrmId());//todo 等待对接发货单号主键
}
String field_J0EN1__c = "";
if(StrUtil.isNotEmpty(orgCode)){
switch (orgCode){
case "1001"://杭州恒华科技有限公司
field_J0EN1__c = "cD2b3f";
break;
case "1002"://杭州华耀商贸有限公司
field_J0EN1__c = "sl2qOPMpO";
break;
case "1004"://诚艺传递华耀
field_J0EN1__c = "sl2qOPMpO";
break;
case "1003"://杭州胡记食品有限公司
field_J0EN1__c = "eq8LyNWe1";
break;
default:
break;
}
}
object_data.put("field_J0EN1__c",field_J0EN1__c); //组织
//拼接组装明细数据
VU9cSalereceiverDetailsEntity details = new VU9cSalereceiverDetailsEntity();
details.setMainId(itemmaster.getId());
List<VU9cSalereceiverDetailsEntity> detailsList = u9cSalereceiverDetailsDao.getu9cSalereceiverDetails(details);
JSONArray object_1n255__cArr = new JSONArray();
JSONObject detailsObj = new JSONObject();
if(null != detailsList && detailsList.size()>0){
for(VU9cSalereceiverDetailsEntity d : detailsList){
JSONObject object_1n255__c = new JSONObject();
object_1n255__c.put("field_q18s0__c",d.getDeliverBillId());//todo 等待对接发货单号主键
object_1n255__c.put("field_126Mr__c",dataId);// CRM表头主键
object_1n255__c.put("field_8v8Np__c",d.getInvName());// 产品名称
object_1n255__c.put("field_hog9b__c",d.getNum());// 数量
object_1n255__c.put("field_bumZ5__c",d.getTaxPrice());// 单价
object_1n255__c.put("field_oZ129__c","");// 回款方式
object_1n255__c.put("field_Tt1kg__c",d.getTaxPriceSum());// 金额
object_1n255__c.put("field_e3NWX__c","");// 备注
object_1n255__c.put("field_y67ja__c",itemmaster.getBillCode());// 回款单编号
object_1n255__c.put("field_4gcxj__c",d.getsRowId());// 发货单明细行号
object_1n255__c.put("field_0dmOD__c",d.getProId());// 产品ID
object_1n255__c.put("field_0I0C5__c",d.getRmaMoney());// 本次退款金额
object_1n255__c.put("field_Fl2r5__c",d.getRmaLine());// 退货单金额
object_1n255__c.put("field_6gfrJ__c",d.getRmaId());// 退货单ID
object_1n255__c.put("field_j8Kdx__c",d.getSoId());// 销售订单ID
object_1n255__c.put("field_vE2T3__c",d.getDocLineNo());//发货单行号
String billType = d.getBillType();
String record_type = "";
if("退回".equals(billType)){
record_type = "record_EjW1M__c";
}
if("出货".equals(billType)){
record_type = "default__c";
}
object_1n255__c.put("record_type",record_type);// 业务类型
object_1n255__cArr.add(object_1n255__c);
}
}
detailsObj.put("object_1n255__c",object_1n255__cArr);
// object_data.put("details",detailsObj);
//拼接结束
data.put("object_data",object_data);
data.put("details",detailsObj);
String apiCode = "";
if(StrUtil.isEmpty(crmId)){
apiCode = "8000090004";
}else{
apiCode = "8000090010";
String r = CrmUtil.unLockAndLock("8000090016","object_ab2ol__c",crmId,tokenObj.getString("corpAccessToken"),CrmUtil.MANAGERCODE,tokenObj.getString("corpId"));
logger.info("回款单解锁"+r);
}
//推送数据到CRM
resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
//todo CRM傅佳敏提出 不管任何原因修改失败都需要再次锁定
if(StrUtil.isNotEmpty(crmId)){
//修改完数据之后需要再次锁定
String r = CrmUtil.unLockAndLock("8000090017","object_ab2ol__c",crmId,tokenObj.getString("corpAccessToken"),CrmUtil.MANAGERCODE,tokenObj.getString("corpId"));
logger.info("回款单锁定"+r);
}
String errorDescription = resultObj.getString("errorDescription");
if("success".equals(errorDescription)){
dataId = resultObj.getString("dataId");
if(StrUtil.isNotEmpty(dataId)){
itemmaster.setDataId(dataId);
vU9cSalereceiverDao.updateState(itemmaster);
}
}
} catch (Exception e) {
itemmaster.setDataId("系统异常,请联系管理员");
vU9cSalereceiverDao.updateState(itemmaster);
e.printStackTrace();
}
logger.info("CRM应收单主表返回信息"+resultObj);
return dataId;
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u9c.unit.dao;
import com.hzya.frame.u9c.unit.entity.VU9cUnitEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (v_u9c_unit: table)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-02 09:34:01
*/
public interface IVU9cUnitDao extends IBaseDao<VU9cUnitEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.u9c.unit.dao.impl;
import com.hzya.frame.u9c.unit.entity.VU9cUnitEntity;
import com.hzya.frame.u9c.unit.dao.IVU9cUnitDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (VU9cUnit)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-02 09:34:15
*/
@Repository("VU9cUnitDaoImpl")
public class VU9cUnitDaoImpl extends MybatisGenericDao<VU9cUnitEntity, String> implements IVU9cUnitDao{
}

View File

@ -0,0 +1,85 @@
package com.hzya.frame.u9c.unit.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cUnit)实体类
*
* @author xiang2lin
* @since 2023-11-02 09:34:17
*/
public class VU9cUnitEntity extends BaseEntity {
private String unitid;
private String unitcode;
private String unitname;
private String status;
private String unitgroupcode;
private String unitgroupname;
private String updateTime;
public String getUnitid() {
return unitid;
}
public void setUnitid(String unitid) {
this.unitid = unitid;
}
public String getUnitcode() {
return unitcode;
}
public void setUnitcode(String unitcode) {
this.unitcode = unitcode;
}
public String getUnitname() {
return unitname;
}
public void setUnitname(String unitname) {
this.unitname = unitname;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getUnitgroupcode() {
return unitgroupcode;
}
public void setUnitgroupcode(String unitgroupcode) {
this.unitgroupcode = unitgroupcode;
}
public String getUnitgroupname() {
return unitgroupname;
}
public void setUnitgroupname(String unitgroupname) {
this.unitgroupname = unitgroupname;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -0,0 +1,117 @@
<?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.u9c.unit.dao.impl.VU9cUnitDaoImpl">
<resultMap id="get-VU9cUnitEntity-result" type="com.hzya.frame.u9c.unit.entity.VU9cUnitEntity" >
<result property="unitid" column="unitId" jdbcType="VARCHAR"/>
<result property="unitcode" column="unitCode" jdbcType="VARCHAR"/>
<result property="unitname" column="unitName" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="unitgroupcode" column="unitGroupCode" jdbcType="VARCHAR"/>
<result property="unitgroupname" column="unitGroupName" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cUnitEntity_Base_Column_List">
unitId
,unitCode
,unitName
,status
,unitGroupCode
,unitGroupName
,update_time
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-VU9cUnitEntity-result" parameterType = "com.hzya.frame.u9c.unit.entity.VU9cUnitEntity">
select
<include refid="VU9cUnitEntity_Base_Column_List" />
from v_u9c_unit
<trim prefix="where" prefixOverrides="and">
<if test="unitid != null and unitid != ''"> and unitId = #{unitid} </if>
<if test="unitcode != null and unitcode != ''"> and unitCode = #{unitcode} </if>
<if test="unitname != null and unitname != ''"> and unitName = #{unitname} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="unitgroupcode != null and unitgroupcode != ''"> and unitGroupCode = #{unitgroupcode} </if>
<if test="unitgroupname != null and unitgroupname != ''"> and unitGroupName = #{unitgroupname} </if>
<if test="updateTime != null and updateTime != ''"> and update_time >= #{updateTime} </if>
</trim>
</select>
<!-- 查询计量单位,睿本云专用 -->
<select id="entity_list_base_reabam" resultMap="get-VU9cUnitEntity-result" parameterType = "com.hzya.frame.u9c.unit.entity.VU9cUnitEntity">
select
<include refid="VU9cUnitEntity_Base_Column_List" />
from v_u9c_unit
<trim prefix="where" prefixOverrides="and">
<if test="unitid != null and unitid != ''"> and unitId = #{unitid} </if>
<if test="unitcode != null and unitcode != ''"> and unitCode = #{unitcode} </if>
<if test="unitname != null and unitname != ''"> and unitName = #{unitname} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="unitgroupcode != null and unitgroupcode != ''"> and unitGroupCode = #{unitgroupcode} </if>
<if test="unitgroupname != null and unitgroupname != ''"> and unitGroupName = #{unitgroupname} </if>
<if test="updateTime != null and updateTime != ''"> and update_time >= #{updateTime} </if>
</trim>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.unit.entity.VU9cUnitEntity">
select count(1) from v_u9c_unit
<trim prefix="where" prefixOverrides="and">
<if test="unitid != null and unitid != ''"> and unitId = #{unitid} </if>
<if test="unitcode != null and unitcode != ''"> and unitCode = #{unitcode} </if>
<if test="unitname != null and unitname != ''"> and unitName = #{unitname} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="unitgroupcode != null and unitgroupcode != ''"> and unitGroupCode = #{unitgroupcode} </if>
<if test="unitgroupname != null and unitgroupname != ''"> and unitGroupName = #{unitgroupname} </if>
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
</trim>
<if test=" sort ==''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VU9cUnitEntity-result" parameterType = "com.hzya.frame.u9c.unit.entity.VU9cUnitEntity">
select
<include refid="VU9cUnitEntity_Base_Column_List" />
from v_u9c_unit
<trim prefix="where" prefixOverrides="and">
<if test="unitid != null and unitid != ''"> and unitId like concat('%',#{unitid},'%') </if>
<if test="unitcode != null and unitcode != ''"> and unitCode like concat('%',#{unitcode},'%') </if>
<if test="unitname != null and unitname != ''"> and unitName like concat('%',#{unitname},'%') </if>
<if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
<if test="unitgroupcode != null and unitgroupcode != ''"> and unitGroupCode like concat('%',#{unitgroupcode},'%') </if>
<if test="unitgroupname != null and unitgroupname != ''"> and unitGroupName like concat('%',#{unitgroupname},'%') </if>
<if test="updateTime != null and updateTime != ''"> and update_time like concat('%',#{updateTime},'%') </if>
</trim>
<if test=" sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="VU9cUnitentity_list_or" resultMap="get-VU9cUnitEntity-result" parameterType = "com.hzya.frame.u9c.unit.entity.VU9cUnitEntity">
select
<include refid="VU9cUnitEntity_Base_Column_List" />
from v_u9c_unit
<trim prefix="where" prefixOverrides="and">
<if test="unitid != null and unitid != ''"> or unitId = #{unitid} </if>
<if test="unitcode != null and unitcode != ''"> or unitCode = #{unitcode} </if>
<if test="unitname != null and unitname != ''"> or unitName = #{unitname} </if>
<if test="status != null and status != ''"> or status = #{status} </if>
<if test="unitgroupcode != null and unitgroupcode != ''"> or unitGroupCode = #{unitgroupcode} </if>
<if test="unitgroupname != null and unitgroupname != ''"> or unitGroupName = #{unitgroupname} </if>
<if test="updateTime != null and updateTime != ''"> or update_time = #{updateTime} </if>
</trim>
<if test=" sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
</mapper>

View File

@ -0,0 +1,21 @@
package com.hzya.frame.u9c.unit.service;
import com.hzya.frame.u9c.unit.entity.VU9cUnitEntity;
import com.hzya.frame.basedao.service.IBaseService;
import java.util.List;
/**
* (VU9cUnit)表服务接口
*
* @author xiang2lin
* @since 2023-11-02 09:34:19
*/
public interface IVU9cUnitService extends IBaseService<VU9cUnitEntity, String>{
/**
* 查询计量单位传睿本云专用
* @param entity
* @return
*/
public List<VU9cUnitEntity> query2Reabam(VU9cUnitEntity entity);
}

View File

@ -0,0 +1,44 @@
package com.hzya.frame.u9c.unit.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.constant.U9Constant;
import com.hzya.frame.u9c.unit.entity.VU9cUnitEntity;
import com.hzya.frame.u9c.unit.dao.IVU9cUnitDao;
import com.hzya.frame.u9c.unit.service.IVU9cUnitService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* (VU9cUnit)表服务实现类
*
* @author xiang2lin
* @since 2023-11-02 09:34:20
*/
@Service("vU9cUnitService")
public class VU9cUnitServiceImpl extends BaseService<VU9cUnitEntity, String> implements IVU9cUnitService {
private IVU9cUnitDao vU9cUnitDao;
@Autowired
public void setVU9cUnitDao(IVU9cUnitDao dao) {
this.vU9cUnitDao = dao;
this.dao = dao;
}
/**
* 查询计量单位传睿本云专用
*
* @param entity
* @return
*/
@DS(U9Constant.DATA_SOURCE_CODE)
@Override
public List<VU9cUnitEntity> query2Reabam(VU9cUnitEntity entity) {
List<VU9cUnitEntity> list = vU9cUnitDao.queryList(entity, "com.hzya.frame.u9c.unit.dao.impl.VU9cUnitDaoImpl.entity_list_base_reabam");
return list;
}
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u9c.unitgroup.dao;
import com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
/**
* (v_u9c_unit_group: table)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-02 10:51:08
*/
public interface IVU9cUnitGroupDao extends IBaseDao<VU9cUnitGroupEntity, String> {
}

View File

@ -0,0 +1,17 @@
package com.hzya.frame.u9c.unitgroup.dao.impl;
import com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity;
import com.hzya.frame.u9c.unitgroup.dao.IVU9cUnitGroupDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
/**
* (VU9cUnitGroup)表数据库访问层
*
* @author xiang2lin
* @since 2023-11-02 10:51:13
*/
@Repository("VU9cUnitGroupDaoImpl")
public class VU9cUnitGroupDaoImpl extends MybatisGenericDao<VU9cUnitGroupEntity, String> implements IVU9cUnitGroupDao{
}

View File

@ -0,0 +1,65 @@
package com.hzya.frame.u9c.unitgroup.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cUnitGroup)实体类
*
* @author xiang2lin
* @since 2023-11-02 10:51:15
*/
public class VU9cUnitGroupEntity extends BaseEntity {
private String unitgroupcode;
private String unitgroupname;
private String unitname;
private String status;
private String baseunit;
public String getUnitgroupcode() {
return unitgroupcode;
}
public void setUnitgroupcode(String unitgroupcode) {
this.unitgroupcode = unitgroupcode;
}
public String getUnitgroupname() {
return unitgroupname;
}
public void setUnitgroupname(String unitgroupname) {
this.unitgroupname = unitgroupname;
}
public String getUnitname() {
return unitname;
}
public void setUnitname(String unitname) {
this.unitname = unitname;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getBaseunit() {
return baseunit;
}
public void setBaseunit(String baseunit) {
this.baseunit = baseunit;
}
}

View File

@ -0,0 +1,164 @@
<?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.u9c.unitgroup.dao.impl.VU9cUnitGroupDaoImpl">
<resultMap id="get-VU9cUnitGroupEntity-result" type="com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity" >
<result property="unitgroupcode" column="unitGroupCode" jdbcType="VARCHAR"/>
<result property="unitgroupname" column="unitGroupName" jdbcType="VARCHAR"/>
<result property="unitname" column="unitName" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="baseunit" column="baseUnit" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cUnitGroupEntity_Base_Column_List">
unitGroupCode
,unitGroupName
,unitName
,status
,baseUnit
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base" resultMap="get-VU9cUnitGroupEntity-result" parameterType = "com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity">
select
<include refid="VU9cUnitGroupEntity_Base_Column_List" />
from v_u9c_unit_group
<trim prefix="where" prefixOverrides="and">
<if test="unitgroupcode != null and unitgroupcode != ''"> and unitGroupCode = #{unitgroupcode} </if>
<if test="unitgroupname != null and unitgroupname != ''"> and unitGroupName = #{unitgroupname} </if>
<if test="unitname != null and unitname != ''"> and unitName = #{unitname} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="baseunit != null and baseunit != ''"> and baseUnit = #{baseunit} </if>
and sts='Y'
</trim>
<if test=" sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity">
select count(1) from v_u9c_unit_group
<trim prefix="where" prefixOverrides="and">
<if test="unitgroupcode != null and unitgroupcode != ''"> and unitGroupCode = #{unitgroupcode} </if>
<if test="unitgroupname != null and unitgroupname != ''"> and unitGroupName = #{unitgroupname} </if>
<if test="unitname != null and unitname != ''"> and unitName = #{unitname} </if>
<if test="status != null and status != ''"> and status = #{status} </if>
<if test="baseunit != null and baseunit != ''"> and baseUnit = #{baseunit} </if>
and sts='Y'
</trim>
<if test=" sort ==''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VU9cUnitGroupEntity-result" parameterType = "com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity">
select
<include refid="VU9cUnitGroupEntity_Base_Column_List" />
from v_u9c_unit_group
<trim prefix="where" prefixOverrides="and">
<if test="unitgroupcode != null and unitgroupcode != ''"> and unitGroupCode like concat('%',#{unitgroupcode},'%') </if>
<if test="unitgroupname != null and unitgroupname != ''"> and unitGroupName like concat('%',#{unitgroupname},'%') </if>
<if test="unitname != null and unitname != ''"> and unitName like concat('%',#{unitname},'%') </if>
<if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
<if test="baseunit != null and baseunit != ''"> and baseUnit like concat('%',#{baseunit},'%') </if>
and sts='Y'
</trim>
<if test=" sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="VU9cUnitGroupentity_list_or" resultMap="get-VU9cUnitGroupEntity-result" parameterType = "com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity">
select
<include refid="VU9cUnitGroupEntity_Base_Column_List" />
from v_u9c_unit_group
<trim prefix="where" prefixOverrides="and">
<if test="unitgroupcode != null and unitgroupcode != ''"> or unitGroupCode = #{unitgroupcode} </if>
<if test="unitgroupname != null and unitgroupname != ''"> or unitGroupName = #{unitgroupname} </if>
<if test="unitname != null and unitname != ''"> or unitName = #{unitname} </if>
<if test="status != null and status != ''"> or status = #{status} </if>
<if test="baseunit != null and baseunit != ''"> or baseUnit = #{baseunit} </if>
and sts='Y'
</trim>
<if test=" sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity" keyProperty="" useGeneratedKeys="true">
insert into v_u9c_unit_group(
<trim suffix="" suffixOverrides=",">
<if test="unitgroupcode != null and unitgroupcode != ''"> unitGroupCode , </if>
<if test="unitgroupname != null and unitgroupname != ''"> unitGroupName , </if>
<if test="unitname != null and unitname != ''"> unitName , </if>
<if test="status != null and status != ''"> status , </if>
<if test="baseunit != null and baseunit != ''"> baseUnit , </if>
<if test="sts == null ">sts,</if>
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="unitgroupcode != null and unitgroupcode != ''"> #{unitgroupcode} ,</if>
<if test="unitgroupname != null and unitgroupname != ''"> #{unitgroupname} ,</if>
<if test="unitname != null and unitname != ''"> #{unitname} ,</if>
<if test="status != null and status != ''"> #{status} ,</if>
<if test="baseunit != null and baseunit != ''"> #{baseunit} ,</if>
<if test="sts == null ">'Y',</if>
</trim>
)
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="" useGeneratedKeys="true">
insert into v_u9c_unit_group(unitGroupCode, unitGroupName, unitName, status, baseUnit, sts)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.unitgroupcode},#{entity.unitgroupname},#{entity.unitname},#{entity.status},#{entity.baseunit}, 'Y')
</foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
insert into v_u9c_unit_group(unitGroupCode, unitGroupName, unitName, status, baseUnit)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.unitgroupcode}, #{entity.unitgroupname}, #{entity.unitname}, #{entity.status}, #{entity.baseunit})
</foreach>
on duplicate key update
unitGroupCode = values(unitGroupCode),
unitGroupName = values(unitGroupName),
unitName = values(unitName),
status = values(status),
baseUnit = values(baseUnit)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity" >
update v_u9c_unit_group set
<trim suffix="" suffixOverrides=",">
<if test="unitgroupcode != null and unitgroupcode != ''"> unitGroupCode = #{unitgroupcode},</if>
<if test="unitgroupname != null and unitgroupname != ''"> unitGroupName = #{unitgroupname},</if>
<if test="unitname != null and unitname != ''"> unitName = #{unitname},</if>
<if test="status != null and status != ''"> status = #{status},</if>
<if test="baseunit != null and baseunit != ''"> baseUnit = #{baseunit},</if>
</trim>
where id= #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity" >
update v_u9c_unit_group set sts= 'N'
where id= #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity" >
update v_u9c_unit_group set sts= 'N'
<trim prefix="where" prefixOverrides="and">
<if test="unitgroupcode != null and unitgroupcode != ''"> or unitGroupCode = #{unitgroupcode} </if>
<if test="unitgroupname != null and unitgroupname != ''"> or unitGroupName = #{unitgroupname} </if>
<if test="unitname != null and unitname != ''"> or unitName = #{unitname} </if>
<if test="status != null and status != ''"> or status = #{status} </if>
<if test="baseunit != null and baseunit != ''"> or baseUnit = #{baseunit} </if>
and sts='Y'
</trim>
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from v_u9c_unit_group where id= #{id}
</delete>
</mapper>

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u9c.unitgroup.service;
import com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (VU9cUnitGroup)表服务接口
*
* @author xiang2lin
* @since 2023-11-02 10:51:16
*/
public interface IVU9cUnitGroupService extends IBaseService<VU9cUnitGroupEntity, String>{
}

View File

@ -0,0 +1,26 @@
package com.hzya.frame.u9c.unitgroup.service.impl;
import com.hzya.frame.u9c.unitgroup.entity.VU9cUnitGroupEntity;
import com.hzya.frame.u9c.unitgroup.dao.IVU9cUnitGroupDao;
import com.hzya.frame.u9c.unitgroup.service.IVU9cUnitGroupService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
/**
* (VU9cUnitGroup)表服务实现类
*
* @author xiang2lin
* @since 2023-11-02 10:51:17
*/
@Service("vU9cUnitGroupService")
public class VU9cUnitGroupServiceImpl extends BaseService<VU9cUnitGroupEntity, String> implements IVU9cUnitGroupService {
private IVU9cUnitGroupDao vU9cUnitGroupDao;
@Autowired
public void setVU9cUnitGroupDao(IVU9cUnitGroupDao dao) {
this.vU9cUnitGroupDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,235 @@
package com.hzya.frame.u9c.util;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.util.HttpUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
/**
* com.hzya.frame.u9c.util
*
* @author yqh
* @date 2023-10 -25 15:26
*/
public class CrmUtil {
protected Logger logger = LogManager.getLogger(super.getClass());
public static String MANAGERCODE = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
public static JSONObject getToken(String permanentCode){
JSONObject main = new JSONObject();
main.put("appId","FSAID_131ca0b");
main.put("appSecret","fdca93109f52427791039af863304887");
main.put("permanentCode","34EF8A65DE83249BA8FCC4E533E9978E");
String baseUrl = "http://bohua.tpddns.cn:9081/kangarooDataCenter/entranceController/externalCallInterface";
String result = HttpRequest.post(baseUrl)
.header("appId", "800009")//头信息多个头信息多次调用此方法即可
.header("apiCode", "8000090001")//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYAP+Oa64gdYq1AG7vPzDGjP+AZCi3QJUBrJkO4NVwAmaFCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "svMDheByZfQSwmLEzJbFnvaMsgvCPf3SFNSCb9HJKIdlMDGJlKMwUmYHpZVd3SURj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(JSON.toJSONString(main))//表单内容
.timeout(20000)//超时毫秒
.execute().body();
if(StrUtil.isNotEmpty(result)){
return analytic(result);
}
return null;
}
public static JSONObject sendU9cTOCrmEsb(String parm,String apiCode){
String baseUrl = "http://bohua.tpddns.cn:9081/kangarooDataCenter/entranceController/externalCallInterface";
// String baseUrl = "http://192.168.2.78:9999/kangarooDataCenter/entranceController/externalCallInterface";
System.out.println("推送参数"+parm);
String result = HttpRequest.post(baseUrl)
.header("appId", "800009")//头信息多个头信息多次调用此方法即可
.header("apiCode", apiCode)//头信息多个头信息多次调用此方法即可
.header("publicKey", "ZJYAP+Oa64gdYq1AG7vPzDGjP+AZCi3QJUBrJkO4NVwAmaFCe7eDIk+3zDUT+v578prj")//头信息多个头信息多次调用此方法即可
.header("secretKey", "svMDheByZfQSwmLEzJbFnvaMsgvCPf3SFNSCb9HJKIdlMDGJlKMwUmYHpZVd3SURj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息多个头信息多次调用此方法即可
.body(parm)//表单内容
.timeout(20000)//超时毫秒
.execute().body();
System.out.println("返回参数"+result);
if(StrUtil.isNotEmpty(result)){
return analytic(result);
}
return null;
}
public static JSONObject analytic(String parm){
JSONObject main = JSON.parseObject(parm);
String status = main.getString("status");
if("200".equals(status)){
String attribute = main.getString("attribute");
//解析token
JSONObject attributeObj = JSON.parseObject(attribute);
String errorMessage = attributeObj.getString("errorMessage");
if("success".equals(errorMessage) || "OK".equals(errorMessage)){
return attributeObj;
}
}
return null;
}
public static String getCustIdByCustName(String custName,String token,String permanentCode,String corpId) {
String apiCode = "8000090008";
JSONObject main = new JSONObject();
main.put("corpAccessToken",token);//token
main.put("corpId",corpId);//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
JSONObject data = new JSONObject();
JSONObject search_query_info = new JSONObject();
search_query_info.put("offset",0);
search_query_info.put("limit",2);
JSONArray filters = new JSONArray();
JSONObject filtersObj = new JSONObject();
filtersObj.put("field_name","name");
filtersObj.put("field_values",custName);
filtersObj.put("operator","EQ");
filters.add(filtersObj);
search_query_info.put("filters",filters);
data.put("dataObjectApiName","AccountObj");
data.put("search_query_info",search_query_info);
main.put("data",data);
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
JSONObject resultData = resultObj.getJSONObject("data");
JSONArray dataList = resultData.getJSONArray("dataList");
if(null != dataList && dataList.size() > 0 ){
Object obj = dataList.get(0);
JSONObject warehouse = JSON.parseObject(obj.toString());
return warehouse.getString("_id");
}
return "";
}
/**
*
* @content 解锁与锁定CRMapi队形
* @author makejava
* @date 2023/12/21 0021 0:10
*
*/
public static String unLockAndLock(String apiCode,String apiName,String crmId,String token,String permanentCode,String corpId) {
JSONObject main = new JSONObject();
main.put("corpAccessToken",token);//token
main.put("corpId",corpId);//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
JSONObject data = new JSONObject();
data.put("dataObjectApiName",apiName);
List<String> dataIds = new ArrayList<>();
dataIds.add(crmId);
data.put("dataIds",dataIds);
data.put("detailObjStrategy","1");
main.put("data",data);
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
return resultObj.toString();
}
public static String getProIdByCode(String code,String org,String token,String permanentCode,String corpId) {
String apiCode = "8000090007";
JSONObject main = new JSONObject();
main.put("corpAccessToken",token);//token
main.put("corpId",corpId);//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
JSONObject data = new JSONObject();
JSONObject search_query_info = new JSONObject();
search_query_info.put("offset",0);
search_query_info.put("limit",2);
JSONArray filters = new JSONArray();
JSONObject filtersObj = new JSONObject();
filtersObj.put("field_name","product_code");
filtersObj.put("field_values",code);
filtersObj.put("operator","EQ");
JSONObject filtersOrg = new JSONObject();
filtersOrg.put("field_name","field_1J9OY__c");
filtersOrg.put("field_values",org);
filtersOrg.put("operator","EQ");
filters.add(filtersOrg);
filters.add(filtersObj);
search_query_info.put("filters",filters);
data.put("dataObjectApiName","ProductObj");
data.put("search_query_info",search_query_info);
main.put("data",data);
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
JSONObject resultData = resultObj.getJSONObject("data");
JSONArray dataList = resultData.getJSONArray("dataList");
if(null != dataList && dataList.size() > 0 ){
Object obj = dataList.get(0);
JSONObject warehouse = JSON.parseObject(obj.toString());
return warehouse.getString("_id");
}
return "";
}
public static String getProIdBySupId(String supId,String token,String permanentCode,String corpId) {
String apiCode = "8000090007";
JSONObject main = new JSONObject();
main.put("corpAccessToken",token);//token
main.put("corpId",corpId);//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
JSONObject data = new JSONObject();
JSONObject search_query_info = new JSONObject();
search_query_info.put("offset",0);
search_query_info.put("limit",2);
JSONArray filters = new JSONArray();
JSONObject filtersObj = new JSONObject();
filtersObj.put("field_name","spu_id");
filtersObj.put("field_values",supId);
filtersObj.put("operator","EQ");
filters.add(filtersObj);
search_query_info.put("filters",filters);
data.put("dataObjectApiName","ProductObj");
data.put("search_query_info",search_query_info);
main.put("data",data);
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
JSONObject resultData = resultObj.getJSONObject("data");
JSONArray dataList = resultData.getJSONArray("dataList");
if(null != dataList && dataList.size() > 0 ){
Object obj = dataList.get(0);
JSONObject warehouse = JSON.parseObject(obj.toString());
return warehouse.getString("_id");
}
return "";
}
public static void main(String[] args) {
getToken("34EF8A65DE83249BA8FCC4E533E9978E");
}
public static String getProIdByName(String name, String token, String permanentCode, String corpId) {
String apiCode = "8000090007";
JSONObject main = new JSONObject();
main.put("corpAccessToken",token);//token
main.put("corpId",corpId);//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
JSONObject data = new JSONObject();
JSONObject search_query_info = new JSONObject();
search_query_info.put("offset",0);
search_query_info.put("limit",2);
JSONArray filters = new JSONArray();
JSONObject filtersObj = new JSONObject();
filtersObj.put("field_name","name");
filtersObj.put("field_values",name);
filtersObj.put("operator","EQ");
filters.add(filtersObj);
search_query_info.put("filters",filters);
data.put("dataObjectApiName","ProductObj");
data.put("search_query_info",search_query_info);
main.put("data",data);
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
JSONObject resultData = resultObj.getJSONObject("data");
JSONArray dataList = resultData.getJSONArray("dataList");
if(null != dataList && dataList.size() > 0 ){
Object obj = dataList.get(0);
JSONObject warehouse = JSON.parseObject(obj.toString());
return warehouse.getString("spu_id");
}
return "";
}
}

View File

@ -0,0 +1,27 @@
package com.hzya.frame.u9c.warehouse.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.warehouse.entity.VU9cWarehouseEntity;
import com.hzya.frame.basedao.dao.IBaseDao;
import java.util.List;
/**
* (view:v_u9c_warehouse)表数据库访问层
*
* @author makejava
* @since 2023-10-26 10:35:59
*/
public interface IVU9cWarehouseDao extends IBaseDao<VU9cWarehouseEntity, String> {
/***
* @Content:查询U9C库存档案
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date 2023年10月26日10:57:32
* @Param
* @return
**/
@DS("henghua_sqlserver_test")
List<VU9cWarehouseEntity> getu9cWarehouse(VU9cWarehouseEntity category);
}

View File

@ -0,0 +1,27 @@
package com.hzya.frame.u9c.warehouse.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.u9c.warehouse.entity.VU9cWarehouseEntity;
import com.hzya.frame.u9c.warehouse.dao.IVU9cWarehouseDao;
import org.springframework.stereotype.Repository;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import java.util.List;
/**
* (VU9cWarehouse)表数据库访问层
*
* @author makejava
* @since 2023-10-26 10:36:05
*/
@Repository("VU9cWarehouseDaoImpl")
public class VU9cWarehouseDaoImpl extends MybatisGenericDao<VU9cWarehouseEntity, String> implements IVU9cWarehouseDao{
@Override
@DS("henghua_sqlserver_test_xel")
public List<VU9cWarehouseEntity> getu9cWarehouse(VU9cWarehouseEntity warehouse) {
return (List<VU9cWarehouseEntity>) super.selectList("com.hzya.frame.u9c.warehouse.dao.impl.VU9cWarehouseDaoImpl.entity_list_base_warehouse",warehouse);
}
}

View File

@ -0,0 +1,180 @@
package com.hzya.frame.u9c.warehouse.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* (VU9cWarehouse)实体类
*
* @author makejava
* @since 2023-10-26 10:36:07
*/
public class VU9cWarehouseEntity extends BaseEntity {
private String id;
private String code;//编码
private String name;//名称
private String orgId;//组织ID
private String spec;//规格
private String invAvailability;//库存可用量
private String reserveQuantity;//预留数量
private String invStock;//库存现存量
private String batch;//批号
private String unit;//计量单位
private String invId;//料品主键
private String updateTime;//更新时间
private String operatorsId;//操作员
private String warehouseName;//仓库
private String allocation;//货位
private String orgCode;//组织编码
private String orgName;//组织名称
private String dataId;//CRM主键
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getInvAvailability() {
return invAvailability;
}
public void setInvAvailability(String invAvailability) {
this.invAvailability = invAvailability;
}
public String getReserveQuantity() {
return reserveQuantity;
}
public void setReserveQuantity(String reserveQuantity) {
this.reserveQuantity = reserveQuantity;
}
public String getInvStock() {
return invStock;
}
public void setInvStock(String invStock) {
this.invStock = invStock;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getInvId() {
return invId;
}
public void setInvId(String invId) {
this.invId = invId;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getOperatorsId() {
return operatorsId;
}
public void setOperatorsId(String operatorsId) {
this.operatorsId = operatorsId;
}
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getAllocation() {
return allocation;
}
public void setAllocation(String allocation) {
this.allocation = allocation;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getOrgName() {
return orgName;
}
public void setOrgName(String orgName) {
this.orgName = orgName;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,39 @@
<?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.u9c.warehouse.dao.impl.VU9cWarehouseDaoImpl">
<resultMap id="get-VU9cWarehouseEntity-result" type="com.hzya.frame.u9c.warehouse.entity.VU9cWarehouseEntity" >
<result property="id" column="id" jdbcType="VARCHAR"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="orgId" column="org_id" jdbcType="VARCHAR"/>
<result property="spec" column="spec" jdbcType="VARCHAR"/>
<result property="invAvailability" column="inv_availability" jdbcType="VARCHAR"/>
<result property="reserveQuantity" column="reserve_quantity" jdbcType="VARCHAR"/>
<result property="invStock" column="inv_stock" jdbcType="VARCHAR"/>
<result property="batch" column="batch" jdbcType="VARCHAR"/>
<result property="unit" column="unit" jdbcType="VARCHAR"/>
<result property="invId" column="inv_id" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
<result property="operatorsId" column="operators_id" jdbcType="VARCHAR"/>
<result property="warehouseName" column="warehouse_name" jdbcType="VARCHAR"/>
<result property="allocation" column="allocation" jdbcType="VARCHAR"/>
<result property="orgCode" column="org_code" jdbcType="VARCHAR"/>
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
</resultMap>
<!-- 查询的字段-->
<sql id = "VU9cWarehouseEntity_Base_Column_List">
id
,code
,name
</sql>
<!-- 查询 采用==查询 -->
<select id="entity_list_base_warehouse" resultMap="get-VU9cWarehouseEntity-result" parameterType = "com.hzya.frame.u9c.warehouse.entity.VU9cWarehouseEntity">
select * from v_u9c_warehouse
where update_time > #{updateTime}
</select>
</mapper>

View File

@ -0,0 +1,20 @@
package com.hzya.frame.u9c.warehouse.service;
import com.hzya.frame.u9c.warehouse.entity.VU9cWarehouseEntity;
import com.hzya.frame.basedao.service.IBaseService;
/**
* (VU9cWarehouse)表服务接口
*
* @author makejava
* @since 2023-10-26 10:36:08
*/
public interface IVU9cWarehouseService extends IBaseService<VU9cWarehouseEntity, String>{
/***
* @Content:查询U9C库存档案
* @Author 👻👻👻👻yqh👻👻👻👻
* @Date
* @Param
* @return
**/
String sendU9cWarehouseToCRM();
}

View File

@ -0,0 +1,222 @@
package com.hzya.frame.u9c.warehouse.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.u9c.util.CrmUtil;
import com.hzya.frame.u9c.warehouse.entity.VU9cWarehouseEntity;
import com.hzya.frame.u9c.warehouse.dao.IVU9cWarehouseDao;
import com.hzya.frame.u9c.warehouse.service.IVU9cWarehouseService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import com.hzya.frame.basedao.service.impl.BaseService;
import java.util.List;
/**
* (VU9cWarehouse)表服务实现类
*
* @author makejava
* @since 2023-10-26 10:36:09
*/
@Service("vU9cWarehouseService")
public class VU9cWarehouseServiceImpl extends BaseService<VU9cWarehouseEntity, String> implements IVU9cWarehouseService {
private IVU9cWarehouseDao vU9cWarehouseDao;
@Autowired
public void setVU9cWarehouseDao(IVU9cWarehouseDao dao) {
this.vU9cWarehouseDao = dao;
this.dao = dao;
}
//上一次同步时间
private String LAST_SYNCHRONISED_TIME = "";
@Override
public String sendU9cWarehouseToCRM() {
JSONObject resultObj = new JSONObject();
//获取待推送的U9c
VU9cWarehouseEntity category = new VU9cWarehouseEntity();
if (StrUtil.isBlank(LAST_SYNCHRONISED_TIME)) {
LAST_SYNCHRONISED_TIME = DateUtil.now();
}
//暂存时间
String temp_time = LAST_SYNCHRONISED_TIME;
category.setUpdateTime(temp_time);
List<VU9cWarehouseEntity> VU9cWarehouseEntityList = vU9cWarehouseDao.getu9cWarehouse(category);
if(VU9cWarehouseEntityList.size()>0){
for(VU9cWarehouseEntity itemmaster : VU9cWarehouseEntityList){
LAST_SYNCHRONISED_TIME = DateUtil.now();
try {
String permanentCode = "FSUID_DB2D1775B48BCDF893538F8CAB2A0EC7";
JSONObject tokenObj = CrmUtil.getToken(permanentCode);
String id = itemmaster.getId();
//杭州恒华科技有限公司
String orgCode = itemmaster.getOrgCode();
String field_ddl10__c = "";
if(StrUtil.isNotEmpty(orgCode)){
switch (orgCode){
//todo 2023年12月18日14:03:28CRM实施与U9实施讨论决定将博华库存推送到恒华
//博华推博华
case "10"://博华
field_ddl10__c = "a2lmNhpo0";
break;
case "1001"://恒华
field_ddl10__c = "cD2b3f";
break;
case "1002"://杭州华耀商贸有限公司
field_ddl10__c = "sl2qOPMpO";
break;
case "1004"://杭州华耀商贸有限公司
field_ddl10__c = "sl2qOPMpO";
break;
case "1003"://杭州胡记食品有限公司
field_ddl10__c = "eq8LyNWe1";
break;
default:
break;
}
}
//通过OA主键查询CRM该库存是否存在如果存在则更新如果不存在则进新增
String code = itemmaster.getCode();
String ctmId = getCrmWarehouse(tokenObj,permanentCode,id,itemmaster,field_ddl10__c);
//拼接传递参数
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
main.put("duplicateCheck",true);
main.put("triggerWorkFlow",true);
JSONObject data = new JSONObject();
data.put("editFlag","1");//状态 暂时默认1
data.put("name",itemmaster.getName());//分类名称
data.put("category_code",itemmaster.getCode());//分类编码
data.put("orderField","1");//排序号 暂时默认1
main.put("data",data);
JSONObject object_data = new JSONObject();
JSONArray owner = new JSONArray();
owner.add(permanentCode);
object_data.put("dataObjectApiName","object_1nkMM__c");
object_data.put("owner",owner);
object_data.put("field_ddl10__c",field_ddl10__c);//组织
String supId = itemmaster.getInvId();
// String proId = CrmUtil.getProIdBySupId(supId,tokenObj.getString("corpAccessToken"),permanentCode,tokenObj.getString("corpId"));
String proId = CrmUtil.getProIdByCode(itemmaster.getCode(),field_ddl10__c,tokenObj.getString("corpAccessToken"),permanentCode,tokenObj.getString("corpId"));
object_data.put("field_qAQj5__c",proId);//产品主键
// object_data.put("field_qAQj5__c","65386572741efa00012ca6c6");//产品主键
// object_data.put("field_K7oi6__c","");//规格
object_data.put("field_MM6hR__c",itemmaster.getUnit());//库存计量单位
object_data.put("field_xkvpd__c",itemmaster.getBatch());//批号
object_data.put("field_5ugda__c",itemmaster.getInvAvailability());//可用库存
object_data.put("field_b1j2M__c",itemmaster.getInvStock());//实际库存
object_data.put("field_r169q__c",itemmaster.getReserveQuantity());//库存预留量
object_data.put("field_u4s12__c",itemmaster.getWarehouseName());//仓库
object_data.put("field_2JAJ3__c",itemmaster.getAllocation());//货位
object_data.put("field_6x27n__c",itemmaster.getId());//U9C库存ID
object_data.put("field_QO1ic__c",itemmaster.getCode());//料品编码
data.put("object_data",object_data);
String apiCode = "";
if(StrUtil.isEmpty(ctmId)){
apiCode = "8000090009";
}else{//更新
object_data.put("_id",ctmId);
// object_data.put("_id","654366aa6de7a000013a8245");
apiCode = "8000090010";
}
resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
String errorDescription = resultObj.getString("errorDescription");
if(null != errorDescription){
if("success".equals(errorDescription)){
String dataId = resultObj.getString("dataId");
if(StrUtil.isNotEmpty(dataId)){
logger.info("更新CRM库存信息成功"+dataId);
}
}
}
logger.info(resultObj.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
return resultObj.toString();
}
public String getCrmWarehouse(JSONObject tokenObj, String permanentCode,String id,VU9cWarehouseEntity itemmaster,String org) {
JSONObject main = new JSONObject();
main.put("corpAccessToken",tokenObj.getString("corpAccessToken"));//token
main.put("corpId",tokenObj.getString("corpId"));//公司
main.put("currentOpenUserId",permanentCode);//操作员主键
JSONObject data = new JSONObject();
data.put("dataObjectApiName","object_1nkMM__c");
JSONObject search_query_info = new JSONObject();
search_query_info.put("offset",0);
search_query_info.put("limit",2);
JSONArray filters = new JSONArray();
JSONObject filtersObj = new JSONObject();
filtersObj.put("field_name","field_QO1ic__c");//编码
filtersObj.put("field_values",itemmaster.getCode());
filtersObj.put("operator","EQ");
JSONObject filtersObjOrg = new JSONObject();
filtersObjOrg.put("field_name","field_ddl10__c");//组织
filtersObjOrg.put("field_values",org);
filtersObjOrg.put("operator","EQ");
JSONObject filtersLife = new JSONObject();
filtersLife.put("field_name","life_status");//生命状态
filtersLife.put("field_values","normal");
filtersLife.put("operator","EQ");
if(StrUtil.isNotEmpty(itemmaster.getWarehouseName())){
JSONObject filtersObjWare = new JSONObject();
filtersObjWare.put("field_name","field_u4s12__c");//仓库
filtersObjWare.put("field_values",itemmaster.getWarehouseName());
filtersObjWare.put("operator","EQ");
filters.add(filtersObjWare);
}
if(StrUtil.isNotEmpty(itemmaster.getBatch())){
JSONObject filtersObjBatch = new JSONObject();
filtersObjBatch.put("field_name","field_xkvpd__c");//批号
filtersObjBatch.put("field_values",itemmaster.getBatch());
filtersObjBatch.put("operator","EQ");
filters.add(filtersObjBatch);
}
if(StrUtil.isNotEmpty(itemmaster.getAllocation())){
JSONObject filtersObjAll = new JSONObject();
filtersObjAll.put("field_name","field_2JAJ3__c");//货位
filtersObjAll.put("field_values",itemmaster.getAllocation());
filtersObjAll.put("operator","EQ");
filters.add(filtersObjAll);
}
filters.add(filtersObj);
filters.add(filtersObjOrg);
search_query_info.put("filters",filters);
data.put("search_query_info",search_query_info);
main.put("data",data);
String apiCode = "8000090011";
JSONObject resultObj = CrmUtil.sendU9cTOCrmEsb(main.toString(),apiCode);
JSONObject resultData = resultObj.getJSONObject("data");
JSONArray dataList = resultData.getJSONArray("dataList");
if(null != dataList && dataList.size() > 0 ){
Object obj = dataList.get(0);
JSONObject warehouse = JSON.parseObject(obj.toString());
return warehouse.getString("_id");
}
return "";
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
</web-app>