This commit is contained in:
lvleigang 2025-03-18 16:39:23 +08:00
commit a445194443
25 changed files with 6378 additions and 0 deletions

View File

@ -80,6 +80,7 @@ public class BaseEntity implements Serializable {
* @return * @return
**/ **/
private String dataSourceCode; private String dataSourceCode;
private String acc_name;
public static long getSerialVersionUID() { public static long getSerialVersionUID() {
return serialVersionUID; return serialVersionUID;
@ -242,6 +243,14 @@ public class BaseEntity implements Serializable {
this.dataSourceCode = "master"; this.dataSourceCode = "master";
} }
public String getAcc_name() {
return acc_name;
}
public void setAcc_name(String acc_name) {
this.acc_name = acc_name;
}
public Long getSorts() { public Long getSorts() {
return sorts; return sorts;
} }

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u8.base.identity.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity;
/**
* @Description 单据主键生成控制表
* @Author xiangerlin
* @Date 2025/3/13 17:01
**/
public interface IUAIdentityDao extends IBaseDao<UAIdentityEntity,String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u8.base.identity.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.u8.base.identity.dao.IUAIdentityDao;
import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity;
import org.springframework.stereotype.Repository;
/**
* @Description
* @Author xiangerlin
* @Date 2025/3/13 17:02
**/
@Repository
public class UAIdentityDaoImpl extends MybatisGenericDao<UAIdentityEntity,String> implements IUAIdentityDao {
}

View File

@ -0,0 +1,60 @@
package com.hzya.frame.u8.base.identity.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description 单据主键生成控制表
* @Author xiang2lin
* @Date 2021/12/27 16:28
**/
public class UAIdentityEntity extends BaseEntity {
/** 无备注 */
private String cVouchType;
/** 无备注 */
private Integer iFatherId;//主表id
/** 无备注 */
private Integer iChildId;//子表id
private String cacc_id;//账套号
private String acc_name;
public String getcVouchType() {
return cVouchType;
}
public void setcVouchType(String cVouchType) {
this.cVouchType = cVouchType;
}
public Integer getiFatherId() {
return iFatherId;
}
public void setiFatherId(Integer iFatherId) {
this.iFatherId = iFatherId;
}
public Integer getiChildId() {
return iChildId;
}
public void setiChildId(Integer iChildId) {
this.iChildId = iChildId;
}
public String getCacc_id() {
return cacc_id;
}
public void setCacc_id(String cacc_id) {
this.cacc_id = cacc_id;
}
public String getAcc_name() {
return acc_name;
}
public void setAcc_name(String acc_name) {
this.acc_name = acc_name;
}
}

View File

@ -0,0 +1,158 @@
<?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.u8.base.identity.entity.UAIdentityEntity">
<resultMap id="get-UAIdentityEntity-result" type="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
<!--无备注 -->
<result property="cVouchType" column="cVouchType" />
<!--无备注 -->
<result property="iFatherId" column="iFatherId" />
<!--无备注 -->
<result property="iChildId" column="iChildId" />
</resultMap>
<sql id="UAIdentityEntity_Base_Column_List">
cVouchType,
iFatherId,
iChildId
</sql>
<!--通过ID获取数据 -->
<select id="UAIdentityEntity_get" resultMap="get-UAIdentityEntity-result">
select
<include refid="UAIdentityEntity_Base_Column_List" />
from UFSystem.UA_Identity where id = #{ id }
</select>
<!-- 销售订单主键id 发布的时候002账套要改成002账套-->
<select id="UAIdentityEntity_list_base_cvouchtype" resultMap="get-UAIdentityEntity-result" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
select
<include refid="UAIdentityEntity_Base_Column_List" />
from UFSystem.dbo.UA_Identity
WHERE cacc_id = #{cacc_id} AND cvouchtype = #{cVouchType}
</select>
<!-- 修改 -->
<update id="UAIdentityEntity_update_iFatherId" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
update UFSystem.dbo.UA_Identity set
<trim suffix="" suffixOverrides=",">
<if test="cVouchType != null and cVouchType !='' "> cVouchType = #{cVouchType},</if>
<if test="iFatherId != null ">iFatherId = #{iFatherId},</if>
<if test="iChildId != null ">iChildId = #{iChildId}</if>
</trim>
where cacc_id = #{cacc_id} AND cvouchtype = #{cVouchType}
</update>
<!-- 查询 采用==查询 -->
<select id="UAIdentityEntity_list_base" resultMap="get-UAIdentityEntity-result" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
select
<include refid="UAIdentityEntity_Base_Column_List" />
from UFSystem.dbo.UA_Identity
<trim prefix="where" prefixOverrides="and">
<if test="cVouchType != null and cVouchType !='' ">cVouchType = #{cVouchType} </if>
<if test="iFatherId != null "> and iFatherId = #{iFatherId}</if>
<if test="iChildId != null "> and iChildId = #{iChildId}</if>
</trim>
<if test=" sort =='' "> order by id desc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询符合条件的数量 -->
<select id="UAIdentityEntity_count" resultType="Integer" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
select count(1) from UA_Identity
<trim prefix="where" prefixOverrides="and">
<if test="cVouchType != null and cVouchType !='' ">cVouchType = #{cVouchType} </if>
<if test="iFatherId != null "> and iFatherId = #{iFatherId} </if>
<if test="iChildId != null "> and iChildId = #{iChildId} </if>
</trim>
<if test=" sort =='' "> order by id desc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
</select>
<!-- 分页查询列表 采用like格式 -->
<select id="UAIdentityEntity_list_like" resultMap="get-UAIdentityEntity-result" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
select
<include refid="UAIdentityEntity_Base_Column_List" />
from UA_Identity
<trim prefix="where" prefixOverrides="and">
<if test="cVouchType != null and cVouchType !='' "> cVouchType like concat('%',#{cVouchType},'%') </if>
<if test="iFatherId != null "> and iFatherId = #{iFatherId}</if>
<if test="iChildId != null "> and iChildId = #{iChildId}</if>
</trim>
<if test=" sort =='' "> order by id desc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 查询列表 字段采用or格式 -->
<select id="UAIdentityEntity_list_or" resultMap="get-UAIdentityEntity-result" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
select
<include refid="UAIdentityEntity_Base_Column_List" />
from UA_Identity
<trim prefix="where" prefixOverrides="or">
<if test="cVouchType != null and cVouchType !='' ">cVouchType = #{cVouchType} </if>
<if test="iFatherId != null "> or iFatherId = #{iFatherId}</if>
<if test="iChildId != null "> or iChildId = #{iChildId}</if>
</trim>
<if test=" sort =='' "> order by id desc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
<!-- 新增 -->
<insert id="UAIdentityEntity_insert" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
insert into UA_Identity(
<trim suffix="" suffixOverrides=",">
<if test="cVouchType != null and cVouchType !='' "> cVouchType, </if>
<if test="iFatherId != null ">iFatherId,</if>
<if test="iChildId != null ">iChildId</if>
</trim>
)values
(
<trim suffix="" suffixOverrides=",">
<if test="cVouchType != null and cVouchType !='' "> #{cVouchType}, </if>
<if test="iFatherId != null ">#{iFatherId},</if>
<if test="iChildId != null ">#{iChildId}</if>
</trim>
)
<selectKey keyProperty="id" resultType="Long" order="AFTER">
select
last_insert_id() as id
</selectKey>
</insert>
<!-- 修改 -->
<update id="UAIdentityEntity_update" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
update UFSystem.dbo.UA_Identity set
<trim suffix="" suffixOverrides=",">
<if test="cVouchType != null and cVouchType !='' "> cVouchType = #{cVouchType},</if>
<if test="iFatherId != null ">iFatherId = #{iFatherId},</if>
<if test="iChildId != null ">iChildId = #{iChildId},</if>
<if test="modify_time != null "> modify_time =#{modify_time} </if>
<if test="modify_time == null "> modify_time = now()</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="UAIdentityEntity_logicDelete" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
update UA_Identity set
sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
id = #{id}
</update>
<!-- 逻辑删除多条件 -->
<update id="UAIdentityEntity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
update UA_Identity set
sts='N',modify_time = now(),modify_user_id = #{modify_user_id}
<trim prefix="where" prefixOverrides="and">
<if test="cVouchType != null and cVouchType !='' ">cVouchType = #{cVouchType} </if>
<if test="iFatherId != null "> and iFatherId = #{iFatherId}</if>
<if test="iChildId != null "> and iChildId = #{iChildId}</if>
</trim>
</update>
<!-- 物理删除 -->
<delete id="UAIdentityEntity_delete" parameterType="com.hzya.frame.u8.base.identity.entity.UAIdentityEntity">
delete from UA_Identity where id =#{id}
</delete>
</mapper>

View File

@ -0,0 +1,30 @@
package com.hzya.frame.u8.base.identity.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity;
import java.util.List;
/**
* @Description 单据主键生成控制表 service
* @Author xiang2lin
* @Date 2021/12/27 16:34
**/
public interface IUAIdentityService extends IBaseService<UAIdentityEntity,String> {
/**
* 查询销售订单最大主键
* @return
* @throws Exception
*/
UAIdentityEntity queryMaxSaleOrderId(String acc_id, String type)throws Exception;
/**
* 更新最大主键
* @param entity
* @return
* @throws Exception
*/
UAIdentityEntity updateMaxSaleOrderId(UAIdentityEntity entity)throws Exception;
}

View File

@ -0,0 +1,84 @@
package com.hzya.frame.u8.base.identity.service.impl;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.u8.base.identity.dao.IUAIdentityDao;
import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity;
import com.hzya.frame.u8.base.identity.service.IUAIdentityService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description 单据主键生成控制表 service
* @Author xiang2lin
* @Date 2021/12/27 16:36
**/
@Service
public class UAIdentityServiceImpl extends BaseService<UAIdentityEntity,String> implements IUAIdentityService {
Logger logger = LogManager.getLogger(IUAIdentityService.class);
private IUAIdentityDao uaIdentityDao;
@Autowired
public void setIuaIdentityDao(IUAIdentityDao dao) {
this.uaIdentityDao = dao;
this.dao = dao;
}
/**
* 查询销售订单最大主键
*
* @return
* @throws Exception
*/
@Override
public UAIdentityEntity queryMaxSaleOrderId(String acc_id, String type) throws Exception {
try{
UAIdentityEntity uaIdentityEntity = new UAIdentityEntity();
uaIdentityEntity.setCacc_id(acc_id);
uaIdentityEntity.setcVouchType(type);
List<UAIdentityEntity> list = uaIdentityDao.queryList(uaIdentityEntity,"com.hzya.frame.u8.base.identity.entity.UAIdentityEntity.UAIdentityEntity_list_base_cvouchtype");
if (CollectionUtils.isNotEmpty(list)){
return list.get(0);
}
}catch (Exception e){
logger.error(e.getMessage());
}
return null;
}
/**
* 更新最大编号
*
* @param entity
* @return
* @throws Exception
*/
@Override
public UAIdentityEntity updateMaxSaleOrderId(UAIdentityEntity entity) throws Exception {
if (null != entity.getiFatherId() && null != entity.getiChildId()){
try{
//最大号+1
UAIdentityEntity uaIdentityEntity = new UAIdentityEntity();
uaIdentityEntity.setCacc_id(entity.getCacc_id());
uaIdentityEntity.setcVouchType(entity.getcVouchType());
uaIdentityEntity.setiFatherId(entity.getiFatherId()+1);
uaIdentityEntity.setiChildId(entity.getiChildId()+1);
uaIdentityEntity.setAcc_name(entity.getAcc_name());
uaIdentityDao.update("com.hzya.frame.u8.base.identity.entity.UAIdentityEntity.UAIdentityEntity_update_iFatherId",uaIdentityEntity);
//sqlSession.update("com.hzya.frame.u8cinterface.identity.entity.UAIdentityEntity.UAIdentityEntity_update_iFatherId",uaIdentityEntity);
return uaIdentityEntity;
}catch (Exception e){
logger.error(e.getMessage());
}
}
return null;
}
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u8.base.inventory.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.u8.base.inventory.entity.BasPartEntity;
/**
* @Description 存货自定义项
* @Author xiangerlin
* @Date 2025/3/13 16:25
**/
public interface IBasPartDao extends IBaseDao<BasPartEntity,String> {
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u8.base.inventory.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.u8.base.inventory.entity.InventoryEntity;
/**
* @Description 存货档案
* @Author xiangerlin
* @Date 2025/3/13 16:02
**/
public interface IInventoryDao extends IBaseDao<InventoryEntity,String> {
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u8.base.inventory.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.u8.base.inventory.entity.InventorySubEntity;
/**
* @Description 存货子表
* @Author xiangerlin
* @Date 2025/3/13 16:30
**/
public interface IInventorySubDao extends IBaseDao<InventorySubEntity,String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u8.base.inventory.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.u8.base.inventory.dao.IBasPartDao;
import com.hzya.frame.u8.base.inventory.entity.BasPartEntity;
import org.springframework.stereotype.Repository;
/**
* @Description 存货自定义项
* @Author xiangerlin
* @Date 2025/3/13 16:26
**/
@Repository
public class BasPartDaoImpl extends MybatisGenericDao<BasPartEntity,String> implements IBasPartDao {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u8.base.inventory.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.u8.base.inventory.dao.IInventoryDao;
import com.hzya.frame.u8.base.inventory.entity.InventoryEntity;
import org.springframework.stereotype.Repository;
/**
* @Description
* @Author xiangerlin
* @Date 2025/3/13 16:03
**/
@Repository
public class InventoryDaoImpl extends MybatisGenericDao<InventoryEntity,String> implements IInventoryDao {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.u8.base.inventory.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.u8.base.inventory.dao.IInventorySubDao;
import com.hzya.frame.u8.base.inventory.entity.InventorySubEntity;
import org.springframework.stereotype.Repository;
/**
* @Description
* @Author xiangerlin
* @Date 2025/3/13 16:33
**/
@Repository
public class InventorySubDaoImpl extends MybatisGenericDao<InventorySubEntity,String> implements IInventorySubDao {
}

View File

@ -0,0 +1,30 @@
package com.hzya.frame.u8.base.inventory.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description 存货档案自定义项
* @Author xiangerlin
* @Date 2025/3/13 16:21
**/
public class BasPartEntity extends BaseEntity {
private String partId;
private String invCode;//物料编码
public String getPartId() {
return partId;
}
public void setPartId(String partId) {
this.partId = partId;
}
public String getInvCode() {
return invCode;
}
public void setInvCode(String invCode) {
this.invCode = invCode;
}
}

View File

@ -0,0 +1,30 @@
<?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.u8cinterface.entity.BasPartEntity">
<resultMap id="get-BasPartEntity-result" type="com.hzya.frame.u8cinterface.entity.BasPartEntity">
<!--无备注 -->
<result property="partId" column="partId" />
<result property="invCode" column="invCode" />
</resultMap>
<sql id="BasPartEntity_Base_Column_List">
partId,
invCode
</sql>
<!-- 查询 采用==查询 -->
<select id="BasPartEntity_list_base" resultMap="get-BasPartEntity-result" parameterType="com.hzya.frame.u8cinterface.entity.BasPartEntity">
select
<include refid="BasPartEntity_Base_Column_List" />
from ${acc_name}bas_part
<trim prefix="where" prefixOverrides="and">
<if test="partId != null and partId !='' ">partId = #{partId} </if>
<if test="invCode != null and invCode !='' "> and invCode = #{invCode}</if>
</trim>
</select>
<insert id="BasPartEntity_insert" parameterType="com.hzya.frame.u8cinterface.entity.BasPartEntity" >
insert into ${acc_name}bas_part (PartId,InvCode )values (#{partId},#{invCode})
</insert>
</mapper>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,60 @@
package com.hzya.frame.u8.base.inventory.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description 存货档案子表
* @Author xiangerlin
* @Date 2025/3/13 16:16
**/
public class InventorySubEntity extends BaseEntity {
private String cInvSubCode;//存货编码
private String bInvKeyPart;//是否关键物料 1是关键物料0不是
private String planCheckDay;//计划检验天数
private String dInvCreateDatetime;//建档日期
private String iDrawType;//领料方式
public String getcInvSubCode() {
return cInvSubCode;
}
public void setcInvSubCode(String cInvSubCode) {
this.cInvSubCode = cInvSubCode;
}
public String getbInvKeyPart() {
return bInvKeyPart;
}
public void setbInvKeyPart(String bInvKeyPart) {
this.bInvKeyPart = bInvKeyPart;
}
public String getPlanCheckDay() {
return planCheckDay;
}
public void setPlanCheckDay(String planCheckDay) {
this.planCheckDay = planCheckDay;
}
public String getdInvCreateDatetime() {
return dInvCreateDatetime;
}
public void setdInvCreateDatetime(String dInvCreateDatetime) {
this.dInvCreateDatetime = dInvCreateDatetime;
}
public String getiDrawType() {
return iDrawType;
}
public void setiDrawType(String iDrawType) {
this.iDrawType = iDrawType;
}
}

View File

@ -0,0 +1,61 @@
<?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.u8.base.inventory.entity.InventorySubEntity">
<resultMap id="get-InventorySubEntity-result" type="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity">
<!--无备注 -->
<result property="cInvSubCode" column="cInvSubCode" />
<result property="bInvKeyPart" column="bInvKeyPart" />
</resultMap>
<sql id="InventorySubEntity_Base_Column_List">
cInvSubCode,
bInvKeyPart
</sql>
<!-- 查询 采用==查询 -->
<select id="InventorySubEntity_list_base" resultMap="get-InventorySubEntity-result" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity">
select
<include refid="InventorySubEntity_Base_Column_List" />
from ${acc_name}Inventory_Sub
<trim prefix="where" prefixOverrides="and">
<if test="cInvSubCode != null and cInvSubCode !='' ">cInvSubCode = #{cInvSubCode} </if>
<if test="bInvKeyPart != null and bInvKeyPart !='' "> and bInvKeyPart = #{bInvKeyPart}</if>
</trim>
</select>
<insert id="InventorySubEntity_insert" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity" >
insert into ${acc_name}Inventory_Sub(
<trim suffix="" suffixOverrides=",">
<if test="cInvSubCode != null and cInvSubCode !='' "> cInvSubCode, </if>
<if test="bInvKeyPart != null and bInvKeyPart !='' "> bInvKeyPart,</if>
<if test="planCheckDay != null and planCheckDay !='' "> iPlanCheckDay,</if>
<if test="dInvCreateDatetime != null and dInvCreateDatetime !='' "> dInvCreateDatetime,</if>
<if test="iDrawType != null and iDrawType !='' "> iDrawType</if>
</trim>
)values
(
<trim suffix="" suffixOverrides=",">
<if test="cInvSubCode != null and cInvSubCode !='' "> #{cInvSubCode}, </if>
<if test="bInvKeyPart != null and bInvKeyPart !='' "> #{bInvKeyPart}, </if>
<if test="planCheckDay != null and planCheckDay !='' "> #{planCheckDay}, </if>
<if test="dInvCreateDatetime != null and dInvCreateDatetime !='' "> #{dInvCreateDatetime}, </if>
<if test="iDrawType != null and iDrawType !='' "> #{iDrawType} </if>
</trim>
)
</insert>
<!-- 更新的时候不更新 dInvCreateDatetime建档日期字段-->
<update id="InventorySubEntity_update" parameterType="com.hzya.frame.u8.base.inventory.entity.InventorySubEntity">
update ${acc_name}Inventory_Sub set
<trim suffix="" suffixOverrides=",">
<if test="cInvSubCode != null and cInvSubCode !='' "> cInvSubCode = #{cInvSubCode},</if>
<if test="bInvKeyPart != null and bInvKeyPart !='' "> bInvKeyPart = #{bInvKeyPart},</if>
<if test="planCheckDay != null and planCheckDay !='' "> iPlanCheckDay = #{planCheckDay},</if>
<if test="iDrawType != null and iDrawType !='' "> iDrawType = #{iDrawType}</if>
</trim>
where cInvSubCode = #{cInvSubCode}
</update>
</mapper>

View File

@ -0,0 +1,14 @@
package com.hzya.frame.u8.base.inventory.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.u8.base.inventory.entity.BasPartEntity;
import java.util.List;
/**
* @Description 存货自由项
* @Author xiangerlin
* @Date 2025/3/13 16:41
**/
public interface IBasPartService extends IBaseService<BasPartEntity,String> {
}

View File

@ -0,0 +1,36 @@
package com.hzya.frame.u8.base.inventory.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.u8.base.inventory.entity.InventoryEntity;
import java.util.List;
/**
* @Description存货档案
* @Author xiangerlin
* @Date 2025/3/13 15:35
**/
public interface IInventoryService extends IBaseService<InventoryEntity,String> {
/**
* 查询存货档案
* @param entity
* @return
* @throws Exception
*/
List<InventoryEntity> queryList(InventoryEntity entity)throws Exception;
/**
* 新增存货档案
* @param entity
* @throws Exception
*/
void saveInventory(InventoryEntity entity)throws Exception;
/**
* 修改存货档案
* @param entity
* @throws Exception
*/
void updateInventory(InventoryEntity entity)throws Exception;
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.u8.base.inventory.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.u8.base.inventory.entity.InventorySubEntity;
/**
* @Description 存货子表
* @Author xiangerlin
* @Date 2025/3/13 16:40
**/
public interface IInventorySubService extends IBaseService<InventorySubEntity,String> {
}

View File

@ -0,0 +1,28 @@
package com.hzya.frame.u8.base.inventory.service.impl;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.u8.base.inventory.dao.IBasPartDao;
import com.hzya.frame.u8.base.inventory.entity.BasPartEntity;
import com.hzya.frame.u8.base.inventory.service.IBasPartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description 存货自由项
* @Author xiangerlin
* @Date 2025/3/13 16:42
**/
@Service
public class BasPartServiceImpl extends BaseService<BasPartEntity,String> implements IBasPartService {
private IBasPartDao basPartDao;
@Autowired
public void setBasPartDao(IBasPartDao dao) {
this.basPartDao = dao;
this.dao = dao;
}
}

View File

@ -0,0 +1,120 @@
package com.hzya.frame.u8.base.inventory.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.serviceUtil.ServiceUtil;
import com.hzya.frame.u8.base.identity.entity.UAIdentityEntity;
import com.hzya.frame.u8.base.identity.service.IUAIdentityService;
import com.hzya.frame.u8.base.inventory.dao.IInventoryDao;
import com.hzya.frame.u8.base.inventory.entity.BasPartEntity;
import com.hzya.frame.u8.base.inventory.entity.InventoryEntity;
import com.hzya.frame.u8.base.inventory.entity.InventorySubEntity;
import com.hzya.frame.u8.base.inventory.service.IBasPartService;
import com.hzya.frame.u8.base.inventory.service.IInventoryService;
import com.hzya.frame.u8.base.inventory.service.IInventorySubService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description
* @Author xiangerlin
* @Date 2025/3/13 15:39
**/
@Service
public class InventoryService extends BaseService<InventoryEntity,String> implements IInventoryService {
Logger logger = LogManager.getLogger(getClass());
private IInventoryDao inventoryDao;
@Autowired
public void setInventoryDao(IInventoryDao dao) {
this.inventoryDao = dao;
this.dao = dao;
}
@Autowired
private IInventorySubService subService;
@Autowired
private IBasPartService basPartService;
@Autowired
private IUAIdentityService uaIdentityService;
/**
* 查询存货档案
*
* @param entity
* @return
* @throws Exception
*/
@DS("#entity.dataSourceCode")
@Override
public List<InventoryEntity> queryList(InventoryEntity entity) throws Exception {
List<InventoryEntity> List = inventoryDao.query(entity);
return List;
}
/**
* 新增存货档案
*
* @param entity
* @throws Exception
*/
@DS("#entity.dataSourceCode")
@Override
public void saveInventory(InventoryEntity entity) throws Exception {
//保存存货信息
inventoryDao.save(entity);
//保存子表数据
InventorySubEntity subEntity = new InventorySubEntity();
subEntity.setDataSourceCode(entity.getDataSourceCode());
subEntity.setcInvSubCode(entity.getcInvCode());
subEntity.setbInvKeyPart("0");//是否关键物料 1是0否
subEntity.setAcc_name(entity.getAcc_name());
subEntity.setPlanCheckDay("0");//计划检验天数
subEntity.setdInvCreateDatetime(DateUtil.now());//建档日期
subEntity.setiDrawType("0");//领料方式 0是直接领用1是申请领用
//检查子表有没有保存过
List<InventorySubEntity> subEntityList = subService.query(subEntity);
if (CollectionUtils.isEmpty(subEntityList)){
subService.save(subEntity);
}else {
subService.update(subEntity);
}
//保存自定义表
BasPartEntity part = new BasPartEntity();
part.setInvCode(entity.getcInvCode());
//先查一下有没有保存过
List<BasPartEntity> partList = basPartService.query(part);
if (CollectionUtils.isEmpty(partList)){
//查最大流水号
UAIdentityEntity uaidenIdentity = uaIdentityService.queryMaxSaleOrderId("", "bas_part");
if (null != uaidenIdentity){
BasPartEntity basPartEntity = new BasPartEntity();
basPartEntity.setInvCode(entity.getcInvCode());
Integer id_num_add = uaidenIdentity.getiFatherId()+1;// +1
long max_id = 1000000000 + id_num_add;//前面拼接上1000000000
//更新最大编号
uaidenIdentity.setCacc_id("002");
uaidenIdentity.setcVouchType("bas_part");
uaIdentityService.updateMaxSaleOrderId(uaidenIdentity);
}
}
}
/**
* 修改存货档案
*
* @param entity
* @throws Exception
*/
@DS("#entity.dataSourceCode")
@Override
public void updateInventory(InventoryEntity entity) throws Exception {
}
}

View File

@ -0,0 +1,25 @@
package com.hzya.frame.u8.base.inventory.service.impl;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.u8.base.inventory.dao.IInventorySubDao;
import com.hzya.frame.u8.base.inventory.entity.InventorySubEntity;
import com.hzya.frame.u8.base.inventory.service.IInventorySubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description
* @Author xiangerlin
* @Date 2025/3/13 16:42
**/
@Service
public class InventorySubServiceImpl extends BaseService<InventorySubEntity,String> implements IInventorySubService {
private IInventorySubDao inventorySubDao;
@Autowired
public void setInventorySubDao(IInventorySubDao dao) {
this.inventorySubDao = dao;
this.dao = dao;
}
}