bug修改代码备份

master
anthonywj 2 years ago
parent 92a6a6d253
commit 9e25fc5036

@ -529,8 +529,8 @@ public class IoCodeTempController extends BaseController {
if (preInCount <= 0) {
return ResultVOUtils.error(500, "预验收库存数量不足!");
} else {
if (StrUtil.isNotEmpty(invPreinDetailEntity.getBatchNo()) && StrUtil.isNotEmpty(addOrderRequest.getBatchNo())
&& !invPreinDetailEntity.getBatchNo().equals(addOrderRequest.getBatchNo())) {
if (StrUtil.isNotEmpty(invPreinDetailEntity.getBatchNo()) && StrUtil.isNotEmpty(udiEntity.getBatchNo())
&& !invPreinDetailEntity.getBatchNo().equals(udiEntity.getBatchNo())) {
return ResultVOUtils.error(500, "当前批次号与预验收录入批次号不匹配!");
}
if (StrUtil.isNotEmpty(orderId)) {//非首次添加
@ -560,8 +560,8 @@ public class IoCodeTempController extends BaseController {
if (preInCount <= 0) {
return ResultVOUtils.error(500, "寄售库存数量不足!");
} else {
if (StrUtil.isNotEmpty(invPreinDetailEntity.getBatchNo()) && StrUtil.isNotEmpty(addOrderRequest.getBatchNo())
&& !invPreinDetailEntity.getBatchNo().equals(addOrderRequest.getBatchNo())) {
if (StrUtil.isNotEmpty(invPreinDetailEntity.getBatchNo()) && StrUtil.isNotEmpty(udiEntity.getBatchNo())
&& !invPreinDetailEntity.getBatchNo().equals(udiEntity.getBatchNo())) {
return ResultVOUtils.error(500, "当前批次号与预验收录入批次号不匹配!");
}
if (StrUtil.isNotEmpty(orderId)) {//非首次添加

@ -131,6 +131,12 @@ public class IoOrderReviewController extends BaseController {
return ResultVOUtils.error(500, "未找到该业务单据");
}
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) {
if (updateExportStatusRequest.isEntrust()) {
EntrustReceEntity entrustReceEntity = entrustReceService.findByUnique(orderEntity.getAction(), getUserId());
if (entrustReceEntity != null && StrUtil.isNotEmpty(entrustReceEntity.getEntrustAction())) {
transferOrder(orderEntity, entrustReceEntity);
}
}
return updateReview(getUser(), orderEntity);
} else if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
return thirdUpdateReview(getUser(), orderEntity);
@ -286,17 +292,18 @@ public class IoOrderReviewController extends BaseController {
supplementOrder.setOriginUllageSupNo(orderEntity.getBillNo());
supplementOrder.setBillNo(supplementOrderNo);
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
if ("1".equals(systemParamConfigEntity.getParamValue())) {
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); //设置状态为补录单据
} else {
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); //设置状态为补录单据
}
// SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
// if ("1".equals(systemParamConfigEntity.getParamValue())) {
// supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); //设置状态为补录单据
// } else {
// supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL); //设置状态为补录单据
// }
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); //设置导出状态为未导出
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE); //设置导出状态为未导出
supplementOrder.setCorpOrderId(CustomUtil.getId() + "x");
//修改往来单位及当前库存号
supplementOrder.setFromCorp(null);
supplementOrder.setFromDeptCode(orderEntity.getDeptCode());
supplementOrder.setFromInvCode(orderEntity.getInvCode());
supplementOrder.setDeptCode(entrustReceEntity.getEntrustDept());
@ -404,6 +411,8 @@ public class IoOrderReviewController extends BaseController {
redisUtil.del(ConstantStatus.REDIS_BILLNO_CODES + orderEntity.getBillNo());
//验收完成->进入流程
ioCheckInoutService.checkSecond(orderEntity);
return ResultVOUtils.success("更新成功");
}
@ -434,15 +443,27 @@ public class IoOrderReviewController extends BaseController {
public BaseResponse reviewSpms(@RequestBody ReviewSpmsRequest reviewSpmsRequest) {
String billNo = reviewSpmsRequest.getBillNo();
if (StrUtil.isEmpty(reviewSpmsRequest.getBillNo())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
AcceptOrderResponse acceptOrderEntity = new AcceptOrderResponse();
Long userId = getUserId();
String errMsg = checkReviewAuth(billNo, userId + "");
EntrustReceEntity entrustReceEntity;
if (StrUtil.isNotEmpty(errMsg)) {
return ResultVOUtils.error(500, errMsg);
if (errMsg.equals("委托验收")) {
IoOrderEntity orderEntity = orderService.findByBillNo(billNo);
entrustReceEntity = entrustReceService.findByUnique(orderEntity.getAction(), userId);
if (entrustReceEntity != null) {
acceptOrderEntity.setEntrust(true);
} else
return ResultVOUtils.error(500, "无权限验收!");
} else
return ResultVOUtils.error(500, errMsg);
}
AcceptOrderResponse acceptOrderEntity = new AcceptOrderResponse();
acceptOrderEntity.setBillNo(billNo);
List<IoOrderDetailResultResponse> datas = (List<IoOrderDetailResultResponse>) redisUtil.get(ConstantStatus.REDIS_BILLNO + billNo);
IoOrderResponse orderResponse;
@ -503,20 +524,21 @@ public class IoOrderReviewController extends BaseController {
//校验用户是否验收权限
private String checkReviewAuth(String orderId, String userId) {
IoOrderEntity orderEntity = orderService.findByBillNo(orderId);
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_REW && orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_REW && orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
return "单据非未验收状态,无法审核!";
}
if (!invBusUserService.exitBus(userId, orderEntity.getAction())) {
EntrustReceEntity entrustReceEntity = entrustReceService.findByUnique(orderEntity.getAction(), Long.parseLong(userId));
if (entrustReceEntity == null) {
return "无验收权限!";
} else {
return "委托验收";
}
} else {
return null;
}
return null;
}
}

@ -11,7 +11,7 @@ import java.util.Date;
@Data
@TableName(value = "basic_corp")
public class BasicCorpEntity {
@TableId(value = "id", type = IdType.INPUT)
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
@ -141,4 +141,4 @@ public class BasicCorpEntity {
private String remark;
}
}

@ -241,7 +241,14 @@ public class IoOrderEntity {
@TableField(value = "checkStatus")
private Integer checkStatus; //确认状态
// 预验收按单出库,退货
@TableField(value = "checkPreInOrders")
private String checkPreInOrders;
// 预验收按货位出库,退货
@TableField(value = "checkPreInSpaceCode")
private String checkPreInSpaceCode;
}

@ -19,7 +19,7 @@ public class AcceptOrderResponse {
private boolean finishAccept;
IoOrderResponse orderEntity;
private boolean entrust;
private List<IoOrderDetailResultResponse> orderDetailEntities;
}

@ -117,12 +117,12 @@ public class IoAddInoutService {
basicCorpEntity.setCorpType(ConstantStatus.CORP_SICK);
basicCorpEntity.setOutType(ConstantStatus.CORP_SICK_SICK);
basicCorpEntity.setName(orderEntity.getFromCorp());
basicCorpService.insertBasicUnitMaintain(basicCorpEntity);
}
orderEntity.setFromCorp(basicCorpEntity.getErpId());
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
basicCorpService.insertBasicUnitMaintain(basicCorpEntity);
}
}

@ -439,7 +439,7 @@ public class IoCheckInoutService {
//业务单正向校验
public String bizNoPiCheck(List<IoOrderDetailBizEntity> orderDetailBizEntities,IoOrderEntity orderEntity) {
public String bizNoPiCheck(List<IoOrderDetailBizEntity> orderDetailBizEntities, IoOrderEntity orderEntity) {
String errMsg = "";
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
@ -855,14 +855,16 @@ public class IoCheckInoutService {
List<IoCodeEntity> backCodeList = new ArrayList<>();
List<IoCodeEntity> codeList = codeService.findByOrderId(orderEntity.getBillNo());
for (IoCodeEntity codeEntity : codeList) {
int count = invPreinProductDetailService.findCountByCode(codeEntity.getCode());
int count = invPreinProductDetailService.findCountBySpaceCode(codeEntity.getCode(), orderEntity.getCheckPreInSpaceCode());
if (count > 0) {
codeEntity.setCount(count);
codeEntity.setReCount(udiCalCountUtil.getActCount(codeEntity.getNameCode()));
codeEntity.setWarehouseCode(orderEntity.getCheckPreInSpaceCode());
backCodeList.add(codeEntity);
genBackOrder(orderEntity, backCodeList);
}
}
genBackOrder(orderEntity, backCodeList);
}
}
// });

@ -54,5 +54,7 @@ public interface InvPreinProductDetailService {
int findCountByCode(String code);
int findCountBySpaceCode(String spaceCode, String code);
InvPreInProductDetailEntity findUseOneByCode(String code);
}

@ -168,10 +168,29 @@ public class InvPreInProductDetailServiceImpl implements InvPreinProductDetailSe
return count;
}
@Override
public int findCountBySpaceCode(String spaceCode, String code) {
List<InvPreInProductDetailEntity> invPreinDetailEntities = invPreInProductDetailDao.selectList(new QueryWrapper<InvPreInProductDetailEntity>().eq("code", code).eq("invSpaceCode", spaceCode));
int count = 0;
if (CollUtil.isNotEmpty(invPreinDetailEntities)) {
for (InvPreInProductDetailEntity invProductDetailEntity : invPreinDetailEntities) {
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT))
count = count + invProductDetailEntity.getReCount();
else {
count = count - invProductDetailEntity.getReCount();
}
}
}
return count;
}
@Override
public InvPreInProductDetailEntity findUseOneByCode(String code) {
List<InvPreInProductDetailEntity> invPreinDetailEntities = invPreInProductDetailDao.selectList(new QueryWrapper<InvPreInProductDetailEntity>().eq("code", code)
.eq("status", ConstantStatus.INVIN_IN).last("limit 1"));
.last("limit 1"));
if (CollUtil.isNotEmpty(invPreinDetailEntities)) {
return invPreinDetailEntities.get(0);
}

@ -237,7 +237,7 @@ public class HeartService {
}
break;
case THIRD_DATA:
if (needExec(info.getBasicThirdDept(), info.getBasicThirdInv(), info.getBasicThirdProducts(),info.getBasicThirdCorp())) {
if (needExec(info.getBasicThirdDept(), info.getBasicThirdInv(), info.getBasicThirdProducts(), info.getBasicThirdCorp())) {
uploadData(exportType, taskId, x -> x.getThirdData(info, taskId, now, syncTime));
}
break;
@ -732,7 +732,7 @@ public class HeartService {
}
//确认有开启第三方仓库信息同步
if(needExec(info.getBasicThirdInv())){
if (needExec(info.getBasicThirdInv())) {
Map<String, Object> map;
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.THR_WAREHOUSE);
@ -1272,7 +1272,8 @@ public class HeartService {
relevanceDao.insertOrUpdateBatch(relevanceList);
}
if (CollectionUtil.isNotEmpty(corpList)) {
corpDao.insertOrUpdateBatch(corpList);
for (BasicCorpEntity basicCorpEntity : corpList)
corpDao.importBasicUnitMaintain(basicCorpEntity);
}
if (CollectionUtil.isNotEmpty(supCertList)) {
supCertDao.insertOrUpdateBatch(supCertList);
@ -1317,6 +1318,7 @@ public class HeartService {
private final BasicBussinessTypeDao bussinessTypeDao;
private final BasicBusTypeChangeDao busTypeChangeDao;
private final ThrBusTypeOriginDao thrBusTypeOriginDao;
/**
*
*
@ -1642,14 +1644,14 @@ public class HeartService {
list.add(systemPDFTemplateEntity.getPath());
});
BaseResponse<String> response = spGetHttp.postTemplateFile(list);
if (response.getCode() == 20000) {
log.info("模板文件列表上传成功");
uploadFileLog = "\n模板文件列表上传成功";
} else {
log.info("模板文件上传失败,响应信息:{}", response.getMessage());
uploadFileLog = "\n模板文件列表上传失败错误信息" + response.getMessage();
}
// BaseResponse<String> response = spGetHttp.postTemplateFile(list);
// if (response.getCode() == 20000) {
// log.info("模板文件列表上传成功");
// uploadFileLog = "\n模板文件列表上传成功";
// } else {
// log.info("模板文件上传失败,响应信息:{}", response.getMessage());
// uploadFileLog = "\n模板文件列表上传失败错误信息" + response.getMessage();
// }
}
if (baseResponse.getCode() == 20000) {
basicExportStatusEntity1.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS);

@ -0,0 +1,34 @@
package com.glxp.api.util;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.net.NetUtil;
import cn.hutool.core.util.IdUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
/**
* @Author tan
* @Date 2021/10/16 16:23
*/
@Component
public class SnowflakeUtil {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private long workerId = 0;//为终端ID
private long dataCenterId = 1;//数据中心ID
private Snowflake snowflake = IdUtil.createSnowflake(workerId,dataCenterId);
@PostConstruct
public void init(){
workerId = NetUtil.ipv4ToLong(NetUtil.getLocalhostStr());
}
public synchronized String snowflakeId(){
return String.valueOf(snowflake.nextId());
}
public synchronized long snowflakeId(long workerId,long dataCenterId){
Snowflake snowflake = IdUtil.createSnowflake(workerId, dataCenterId);
return snowflake.nextId();
}
}

@ -2,24 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.basic.BasicCorpDao">
<select id="filterList" parameterType="com.glxp.api.req.basic.BasicUnitMaintainFilterRequest"
resultType="com.glxp.api.entity.basic.BasicCorpEntity">
SELECT * FROM basic_corp
SELECT *
FROM basic_corp
<where>
<if test="key != '' and key!=null">
<if test="key != '' and key != null">
and
( name like concat('%',#{key},'%')
or spell like concat('%',#{key},'%')
or erpId like concat('%',#{key},'%')
or creditNo like concat('%',#{key},'%')
or thirdId like concat('%',#{key},'%')
or thirdId1 like concat('%',#{key},'%')
or thirdId2 like concat('%',#{key},'%')
or thirdId3 like concat('%',#{key},'%')
or thirdId4 like concat('%',#{key},'%')
or addr like concat('%',#{key},'%')
)
(name like concat('%', #{key}, '%')
or spell like concat('%', #{key}, '%')
or erpId like concat('%', #{key}, '%')
or creditNo like concat('%', #{key}, '%')
or thirdId like concat('%', #{key}, '%')
or thirdId1 like concat('%', #{key}, '%')
or thirdId2 like concat('%', #{key}, '%')
or thirdId3 like concat('%', #{key}, '%')
or thirdId4 like concat('%', #{key}, '%')
or addr like concat('%', #{key}, '%')
)
</if>
<if test="id != '' and id != null">
AND id = #{id}
@ -34,20 +34,21 @@
AND corpType = #{corpType}
</if>
<if test="outType != null">
AND ( outType <![CDATA[ <> ]]> #{outType} or outType is NULL)
AND (outType <![CDATA[ <> ]]> #{outType} or outType is NULL)
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
order by updateTime desc
</select>
<select id="selectByThirdId" parameterType="com.glxp.api.req.basic.BasicUnitMaintainFilterRequest"
resultType="com.glxp.api.entity.basic.BasicCorpEntity">
select * FROM basic_corp
select *
FROM basic_corp
<where>
<if test="thirdId != '' and thirdId != null">
AND thirdId = #{thirdId}
@ -74,84 +75,81 @@
<insert id="insertBasicUnitMaintain" keyProperty="id"
parameterType="com.glxp.api.entity.basic.BasicCorpEntity">
REPLACE
INTO basic_corp
(thirdId,erpId,name,spell,
addr,status,type,creditNo,contact,mobile,thirdId1,thirdId2,thirdId3,thirdId4,
thirdName,thirdName1,thirdName2,thirdName3,thirdName4,updateTime,corpType,outType,createUser,createTime,updateUser,remark)
values
(
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark}
)
INTO basic_corp
(thirdId, erpId, name, spell,
addr, status, type, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType, createUser,
createTime, updateUser, remark)
values (#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark})
</insert>
<insert id="insertThrUnitMaintainignore" keyProperty="id"
parameterType="com.glxp.api.res.thrsys.ThrUnitMaintainResponse">
insert
ignore
ignore
INTO basic_corp
(thirdId,erpId,name,spell,
addr,status,type,creditNo,contact,mobile,thirdId1,thirdId2,thirdId3,thirdId4,
thirdName,thirdName1,thirdName2,thirdName3,thirdName4,updateTime,corpType,outType,createUser,createTime,updateUser,remark)
values
(
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark}
)
(thirdId, erpId, name, spell,
addr, status, type, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType, createUser,
createTime, updateUser, remark)
values (#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark})
</insert>
<insert id="insert" parameterType="com.glxp.api.entity.basic.BasicCorpEntity">
insert INTO basic_corp(thirdId, erpId, name, spell, addr,
status, type, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType,createUser,createTime,updateUser,remark)
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType,
createUser, createTime, updateUser, remark)
values (#{thirdId},
#{erpId},
#{name},
@ -164,7 +162,7 @@
#{mobile},
#{thirdId1}, #{thirdId2}, #{thirdId3}, #{thirdId4},
#{thirdName}, #{thirdName1}, #{thirdName2}, #{thirdName3}, #{thirdName4}, #{updateTime}, #{corpType},
#{outType},#{createUser},
#{outType}, #{createUser},
#{createTime},
#{updateUser},
#{remark})
@ -174,34 +172,86 @@
<update id="customUpdateById" parameterType="com.glxp.api.entity.basic.BasicCorpEntity">
UPDATE basic_corp
<trim prefix="set" suffixOverrides=",">
<if test="thirdId != null">thirdId=#{thirdId},</if>
<if test="erpId != null">erpId=#{erpId},</if>
<if test="name != null">name=#{name},</if>
<if test="spell != null">spell=#{spell},</if>
<if test="addr != null">addr=#{addr},</if>
<if test="status != null">status=#{status},</if>
<if test="type != null">type=#{type},</if>
<if test="creditNo != null">creditNo=#{creditNo},</if>
<if test="contact != null">contact=#{contact},</if>
<if test="mobile != null">mobile=#{mobile},</if>
<if test="thirdId1 != null">thirdId1=#{thirdId1},</if>
<if test="thirdId2 != null">thirdId2=#{thirdId2},</if>
<if test="thirdId3 != null">thirdId3=#{thirdId3},</if>
<if test="thirdId4 != null">thirdId4=#{thirdId4},</if>
<if test="thirdName != null">thirdName=#{thirdName},</if>
<if test="thirdName1 != null">thirdName1=#{thirdName1},</if>
<if test="thirdName2 != null">thirdName2=#{thirdName2},</if>
<if test="thirdName3 != null">thirdName3=#{thirdName3},</if>
<if test="thirdName4 != null">thirdName4=#{thirdName4},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="corpType != null">corpType=#{corpType},</if>
<if test="outType != null">outType=#{outType},</if>
<if test="createUser != null">createUser=#{createUser},</if>
<if test="createTime != null">createTime=#{createTime},</if>
<if test="updateUser != null">updateUser=#{updateUser},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="thirdId != null">
thirdId=#{thirdId},
</if>
<if test="erpId != null">
erpId=#{erpId},
</if>
<if test="name != null">
name=#{name},
</if>
<if test="spell != null">
spell=#{spell},
</if>
<if test="addr != null">
addr=#{addr},
</if>
<if test="status != null">
status=#{status},
</if>
<if test="type != null">
type=#{type},
</if>
<if test="creditNo != null">
creditNo=#{creditNo},
</if>
<if test="contact != null">
contact=#{contact},
</if>
<if test="mobile != null">
mobile=#{mobile},
</if>
<if test="thirdId1 != null">
thirdId1=#{thirdId1},
</if>
<if test="thirdId2 != null">
thirdId2=#{thirdId2},
</if>
<if test="thirdId3 != null">
thirdId3=#{thirdId3},
</if>
<if test="thirdId4 != null">
thirdId4=#{thirdId4},
</if>
<if test="thirdName != null">
thirdName=#{thirdName},
</if>
<if test="thirdName1 != null">
thirdName1=#{thirdName1},
</if>
<if test="thirdName2 != null">
thirdName2=#{thirdName2},
</if>
<if test="thirdName3 != null">
thirdName3=#{thirdName3},
</if>
<if test="thirdName4 != null">
thirdName4=#{thirdName4},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="corpType != null">
corpType=#{corpType},
</if>
<if test="outType != null">
outType=#{outType},
</if>
<if test="createUser != null">
createUser=#{createUser},
</if>
<if test="createTime != null">
createTime=#{createTime},
</if>
<if test="updateUser != null">
updateUser=#{updateUser},
</if>
<if test="remark != null">
remark=#{remark},
</if>
</trim>
WHERE id=#{id}
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
@ -238,43 +288,43 @@
resultType="com.glxp.api.entity.basic.BasicCorpEntity">
SELECT *
FROM basic_corp
WHERE (name = #{name}) limit 1
WHERE (name = #{name})
limit 1
</select>
<insert id="importBasicUnitMaintain" keyProperty="id">
REPLACE
INTO basic_corp
( thirdId, erpId, `name`, spell,
INTO basic_corp
(thirdId, erpId, `name`, spell,
addr, status, `type`, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4,
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType,outType,createUser,createTime,updateUser,remark)
values (
#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark}
)
thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType, outType, createUser,
createTime, updateUser, remark)
values (#{thirdId},
#{erpId},
#{name},
#{spell},
#{addr},
#{status},
#{type},
#{creditNo},
#{contact},
#{mobile},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{thirdName},
#{thirdName1},
#{thirdName2},
#{thirdName3},
#{thirdName4},
#{updateTime},
#{corpType},
#{outType},
#{createUser},
#{createTime},
#{updateUser},
#{remark})
</insert>
<select id="batchSelectByErpIdsAndName" resultType="com.glxp.api.entity.basic.BasicCorpEntity">
@ -285,7 +335,7 @@
AND name like concat('%', #{name}, '%')
</if>
<if test="erpIds != null and erpIds.size() != 0">
AND erpId in
AND erpId in
<foreach collection="erpIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
@ -294,7 +344,8 @@
</select>
<select id="selectByNameAndCreditNo" resultType="com.glxp.api.entity.basic.BasicCorpEntity">
select * from basic_corp
select *
from basic_corp
<where>
<if test="name != null and name != ''">
AND name = #{name}
@ -306,21 +357,22 @@
</select>
<select id="selectByErpId" resultType="com.glxp.api.entity.basic.BasicCorpEntity">
select * from basic_corp where erpId = #{erpId}
select *
from basic_corp
where erpId = #{erpId}
</select>
<select id="selectNameByErpId" resultType="java.lang.String">
select name from basic_corp where erpId = #{supId}
select name
from basic_corp
where erpId = #{supId}
</select>
<select id="getCorpList" resultType="com.glxp.api.entity.basic.BasicCorpEntity">
SELECT
*
FROM
basic_corp
WHERE
erpId NOT IN ( SELECT customerId FROM sup_company )
SELECT *
FROM basic_corp
WHERE erpId NOT IN (SELECT customerId FROM sup_company)
AND corpType = 2;
</select>
</mapper>

@ -1,48 +1,43 @@
<?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.glxp.api.dao.basic.BasicHospTypeDao">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicHospTypeEntity">
<!--@mbg.generated-->
<!--@Table basic_hosp_type-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="parentCode" jdbcType="VARCHAR" property="parentCode" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
<result column="createUser" jdbcType="VARCHAR" property="createUser" />
<result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, code, parentCode, `name`, remark, createTime, updateTime, `createUser`, updateUser
</sql>
<resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicHospTypeEntity">
<!--@mbg.generated-->
<!--@Table basic_hosp_type-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="parentCode" jdbcType="VARCHAR" property="parentCode"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="createTime" jdbcType="TIMESTAMP" property="createTime"/>
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="createUser" jdbcType="VARCHAR" property="createUser"/>
<result column="updateUser" jdbcType="VARCHAR" property="updateUser"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, code, parentCode, `name`, remark, createTime, updateTime, `createUser`, updateUser
</sql>
<select id="getTreeList" resultType="com.glxp.api.res.basic.BasicHospTypeResponse">
SELECT id, code,name as label,parentCode FROM basic_hosp_type ORDER BY id DESC
</select>
<select id="selectLowTypeAll" parameterType="java.lang.String" resultType="com.glxp.api.entity.basic.BasicHospTypeEntity">
WITH recursive table_a AS (
SELECT
*
FROM
basic_hosp_type ta
WHERE
code = #{code}
UNION ALL
SELECT
tb.*
FROM
basic_hosp_type tb
INNER JOIN table_a ON table_a.CODE = tb.parentCode
) SELECT
*
FROM
table_a
</select>
<select id="getTreeList" resultType="com.glxp.api.res.basic.BasicHospTypeResponse">
SELECT id, code, name as label, parentCode
FROM basic_hosp_type
ORDER BY id DESC
</select>
<select id="selectLowTypeAll" parameterType="java.lang.String"
resultType="com.glxp.api.entity.basic.BasicHospTypeEntity">
WITH recursive table_a AS (
SELECT *
FROM basic_hosp_type ta
WHERE code = #{code}
UNION ALL
SELECT tb.*
FROM basic_hosp_type tb
INNER JOIN table_a ON table_a.CODE = tb.parentCode
)
SELECT *
FROM table_a
</select>
</mapper>

@ -74,4 +74,49 @@
</if>
</where>
</delete>
<select id="selectGroupDetail" resultType="com.glxp.api.entity.inv.InvPreInProductDetailEntity">
select *
from inv_prein_product_detail
<where>
<if test="code != null and code != ''">
AND code = #{code}
</if>
<if test="mainAction != null and mainAction != ''">
AND mainAction = #{mainAction}
</if>
<if test="action != null and action != ''">
AND action = #{action}
</if>
<if test="supId != null and supId != ''">
and supId = #{supId}
</if>
<if test="relId != null and relId != ''">
AND relId = #{relId}
</if>
<if test="nameCode != null and nameCode != ''">
AND nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="orderId != null and orderId != ''">
AND orderId = #{orderId}
</if>
<if test="deptCode != null and deptCode != ''">
AND deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND invCode = #{invCode}
</if>
<if test="invSpaceCode != null and invSpaceCode != ''">
AND invSpaceCode = #{invSpaceCode}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="batchNo == null and batchNo == ''">
AND batchNo is null
</if>
</where>
group by
</select>
</mapper>

@ -217,6 +217,7 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'sortNum', 'int', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'preInBackAction', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'backPreinType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkPreInOrders', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkPreInSpaceCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('sys_hosp_config', 'thirdSys', 'varchar(255)', 1);

Loading…
Cancel
Save