物流模块

master
yangwl 3 years ago
parent c55c19ac02
commit 77ca239149

@ -50,4 +50,6 @@ public interface AbnormalBillMapper extends BaseMapper<AbnormalBill> {
Map<String,String> findReplaceMessageByAbnormal(@Param("abnormalBill")AbnormalBill abnormalBill);
List<ScrapDto> findScrapDtoList(String site);
Map<String, String> findReplaceMessageResrce(@Param("abnormalBill")AbnormalBill abnormalBill);
}

@ -365,7 +365,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
*/
//发送消息
if(Constants.NEW.equals(abnormalBill.getStatus())){
if(Constants.NEW.equals(abnormalBill.getStatus()) ){
this.anomalyCreatedAndSendMessage(abnormalBill,null);
}
return message;
@ -913,7 +913,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}else if("S".equals(type)){//设备异常
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_DEVICE", 1, null).get(0);
}else if ("T".equals(type)){
abnormalNo = nextNumberHelper.getNextNumber(site, "TRANSPORT", 1, null).get(0);
abnormalNo = nextNumberHelper.getNextNumber("1000", "TRANSPORT", 1, null).get(0);
}
return abnormalNo;
}
@ -1212,13 +1212,31 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//发送消息
if(!Constants.ABNORMAL_MESSAGE_RESPONSE.equals(abnormalMessage.getNode())){
List<NwaUser> nwaUsers = nwaUserService.checkUserGroup(site,abnormalMessage.getSendUserGroup());
//给设备处发企业微信消息
//给生产组
List<NwaUser> nwaUsers_sc = nwaUserService.checkUserGroup(site,"SBYCSB-SHENGCHAN");
if(nwaUsers_sc != null && nwaUsers_sc.size() <= 0){
throw new BaseException("消息发送失败,生产用户组下面没有用户");
}
if(nwaUsers != null && nwaUsers.size() <= 0){
throw new BaseException("消息发送失败,发送的用户组下面没有用户");
}
List<String> customFieldByUserId = usrMapper.findCustomFieldByUserId(site, nwaUsers);
List<String> customFieldByUserId_sc = usrMapper.findCustomFieldByUserId(site, nwaUsers_sc);
if(customFieldByUserId != null && customFieldByUserId.size() <= 0){
throw new BaseException("消息发送失败,发送的用户组下面的用户的自定义数据没有维护");
}
if(customFieldByUserId_sc != null && customFieldByUserId_sc.size() <= 0){
throw new BaseException("消息发送失败,生产用户组下面的用户的自定义数据没有维护");
}
StringBuilder sendUsers = new StringBuilder();
for (int i = 0; i < Objects.requireNonNull(customFieldByUserId).size(); i++) {
if(i == (customFieldByUserId.size() - 1)){
@ -1227,6 +1245,17 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
sendUsers.append(customFieldByUserId.get(i)).append("|");
}
}
StringBuilder sendUsers_sc = new StringBuilder();
for (int i = 0; i < Objects.requireNonNull(customFieldByUserId_sc).size(); i++) {
if(i == (customFieldByUserId.size() - 1)){
sendUsers_sc.append(customFieldByUserId_sc.get(i));
}else{
sendUsers_sc.append(customFieldByUserId_sc.get(i)).append("|");
}
}
activeMQUtil.wechatSendMessage(sendUsers_sc.toString(),abnormalMessage.getContent());
activeMQUtil.wechatSendMessage(sendUsers.toString(),abnormalMessage.getContent());
}
@ -1247,6 +1276,12 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
//找到要替换的消息
Map<String, String> replaceMessage = abnormalBillMapper.findReplaceMessageByAbnormal(abnormalBill);
if (abnormalBill.getType().equals("S")){
replaceMessage=abnormalBillMapper.findReplaceMessageResrce(abnormalBill);
}
String messageBody = sendMessageType.getBody();
//格式化之后的消息
return StringUtils.format(messageBody, replaceMessage);
@ -1450,6 +1485,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
//根据异常单的状态找到对应的用户组
switch (status){
case Constants.NEW:
userGroup="TEXT-1";
case Constants.RESPONSE:
userGroup = abnormalBill.getReportSendUserGroup();
break;
@ -1472,6 +1508,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
throw new BaseException("消息发送失败,找不到对应的用户组");
}else{
//可能为多个用户组
String[] splitUserGroup = userGroup.split(",");
for (String spUserGroup: splitUserGroup) {
MessageType thisType;

@ -261,7 +261,7 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
*
*/
if(abnormalPlan.getShopOrder()==null||abnormalPlan.getShopOrder()==""){
if(abnormalPlan.getAbnormalMethod()=="P" || abnormalPlan.getAbnormalMethod()=="F" || abnormalPlan.getAbnormalMethod()=="FW" || abnormalPlan.getAbnormalMethod()=="FB"){
if(abnormalPlan.getAbnormalMethod().equals("P") || abnormalPlan.getAbnormalMethod().equals("F") || abnormalPlan.getAbnormalMethod().equals("FW") || abnormalPlan.getAbnormalMethod().equals("FB")){
shopOrder.setShopOrder(abnormalBill.getAbnormalNo());
shopOrder.setPlannedItemBo(abnormalBill.getItemBo());
shopOrder.setPlannedBomBo(abnormalBill.getAbnormalNo());
@ -293,6 +293,9 @@ public class AbnormalPlanServiceImpl extends ServiceImpl<AbnormalPlanMapper, Abn
this.saveOrUpdateBatch(abnormalPlans);
}
@Override
public void sendMessage(AbnormalBill abnormalBill, AbnormalPlan abnormalPlan) {
//创建一个消息记录表

@ -1362,5 +1362,27 @@
zab.CANCEL_REASON
</select>
<select id="findReplaceMessageResrce" resultType="java.util.HashMap">
SELECT wct.DESCRIPTION WORKCENTER,r.DESCRIPTION "RESOURCE",zab.PB_DESCRIPTION
FROM Z_ABNORMAL_BILL zab
LEFT JOIN RESRCE r
ON r.RESRCE = zab.RESRCE AND r.SITE = zab.SITE
LEFT JOIN WORK_CENTER wc
ON wc.WORK_CENTER = zab.WORK_CENTER AND wc.SITE = zab.SITE
LEFT JOIN WORK_CENTER_T wct
ON wct.WORK_CENTER_BO = wc.HANDLE AND wct.LOCALE = 'zh'
<where>
<if test="abnormalBill != null">
zab.SITE = #{abnormalBill.site}
<if test="abnormalBill.abnormalNo != null and abnormalBill.abnormalNo != ''">
AND zab.ABNORMAL_NO = #{abnormalBill.abnormalNo}
</if>
<if test="abnormalBill.handle != null and abnormalBill.handle != ''">
AND zab.HANDLE = #{abnormalBill.handle}
</if>
</if>
</where>
GROUP BY wct.DESCRIPTION ,r.DESCRIPTION,zab.PB_DESCRIPTION
</select>
</mapper>

@ -219,4 +219,8 @@ public interface Constants {
String LOGISTICS_NEW="NEW";
String LOGISTICS_TRANSPORT="LOGISTICS_TRANSPORT";
String LOGISTICS_COM="COM";
//入库
String RK="RK";
}

@ -3,8 +3,11 @@ package com.foreverwin.mesnac.meapi.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.mesnac.meapi.enums.HandleEnum;
import com.foreverwin.mesnac.meapi.model.LogisticsBill;
import com.foreverwin.mesnac.meapi.model.UserGroup;
import com.foreverwin.mesnac.meapi.service.LogisticsBillService;
import com.foreverwin.mesnac.meapi.service.UserGroupService;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
@ -25,7 +28,7 @@ import java.util.Optional;
/**
*
* @author YANG.WL
* @since 2022-08-04
* @since 2022-08-08
*/
@RestController
@RequestMapping("/Z-LOGISTICS-TURNOVER")
@ -35,7 +38,8 @@ public class LogisticsTurnoverController {
public LogisticsTurnoverService logisticsTurnoverService;
@Autowired
public LogisticsBillService logisticsBillService;
@Autowired
private UserGroupService userGroupService;
/**
* id
*
@ -63,22 +67,6 @@ public class LogisticsTurnoverController {
return R.ok(result);
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("/queryLogisticsTurnoverList")
public String queryLogisticsTurnoverList(LogisticsDto logisticsDto){
List<LogisticsDto> result;
// QueryWrapper<LogisticsTurnover> queryWrapper = new QueryWrapper<>();
// queryWrapper.setEntity(logisticsTurnover);
result = logisticsTurnoverService.queryLogisticsTurnoverList(logisticsDto);
return Optional.ofNullable(result)
.map(t -> JSONObject.toJSONString(t)).orElse("null");
}
/**
*
*
@ -105,12 +93,34 @@ public class LogisticsTurnoverController {
.or().like(LogisticsTurnover::getStorageLocation, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getTurnoverWorkCenter, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getIsReceive, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getTurnoutWorkcenter, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getTurnoutItem, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getOther4, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getOther5, frontPage.getGlobalQuery())
.or().like(LogisticsTurnover::getOther6, frontPage.getGlobalQuery())
);
}
result = logisticsTurnoverService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
*
* @param logisticsDto
* @return
*/
@ResponseBody
@GetMapping("/querylogisticsturnovelist")
public R logisticsturnoverpage(LogisticsDto logisticsDto){
List<LogisticsDto> result;
result = logisticsTurnoverService.selectlogisticsturnoverlist(logisticsDto);
return R.ok(result);
}
/**
*
* @param logisticsTurnover
@ -153,6 +163,49 @@ public class LogisticsTurnoverController {
return R.ok(logisticsTurnoverService.removeByIds(ids));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("/queryLogisticsTurnoverList")
public String queryLogisticsTurnoverList(String login_name){
//查询登录人员所在的用户组
String userBo = HandleEnum.USER.getHandle("1000", login_name);
List<UserGroup> userGroupList = userGroupService.getUserGroupListByUserBo(userBo);
List<LogisticsDto> result=new ArrayList<>();
if (userGroupList != null && userGroupList.size() > 0) {
for (UserGroup userGroupModel: userGroupList) {
String userGroup = userGroupModel.getUserGroup();
if ("WL-HJ-HJ".equals(userGroup)) {
result = logisticsTurnoverService.queryLogisticsTurnoverList(userGroup,null,null,null);
break;
} else if ("WL-HJ-XL".equals(userGroup)) {
result = logisticsTurnoverService.queryLogisticsTurnoverList(null,userGroup,null,null);
break;
} else if ("WL-JJ-JJ".equals(userGroup)) {
result = logisticsTurnoverService.queryLogisticsTurnoverList(null,null,userGroup,null);
break;
} else if ("WL-WX-WX".equals(userGroup)) {
result = logisticsTurnoverService.queryLogisticsTurnoverList(null,null,null,userGroup);
break;
}
}
return Optional.ofNullable(result)
.map(t -> JSONObject.toJSONString(t)).orElse("null");
}else {
return null;
}
// QueryWrapper<LogisticsTurnover> queryWrapper = new QueryWrapper<>();
// queryWrapper.setEntity(logisticsTurnover);
}
/**
*
* @param list ID
@ -160,28 +213,37 @@ public class LogisticsTurnoverController {
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/UPDATE-STATUS")
public R updateStatusById(String list,String location,String transportno){
List<LogisticsDto> logisticsDtoList = JSONArray.parseArray(list,LogisticsDto.class);
List<LogisticsTurnover> logisticsTurnoverList=new ArrayList<>();
LogisticsTurnover logisticsTurnover=new LogisticsTurnover();
LogisticsBill logisticsBill=new LogisticsBill();
if (!list.isEmpty() && location!=null && transportno!=null){
for (LogisticsDto logisticsDto:logisticsDtoList) {
public R updateStatusById(String list,String location,String transportno,String user,String username) {
List<LogisticsDto> logisticsDtoList = JSONArray.parseArray(list, LogisticsDto.class);
List<LogisticsTurnover> logisticsTurnoverList = new ArrayList<>();
LogisticsTurnover logisticsTurnover = new LogisticsTurnover();
LogisticsBill logisticsBill = new LogisticsBill();
List<LogisticsBill> logisticsBillList = new ArrayList<>();
if (!list.isEmpty() && location != null && transportno != null) {
for (LogisticsDto logisticsDto : logisticsDtoList) {
logisticsTurnover.setHandle(logisticsDto.getHandle());
logisticsTurnover.setStatus("COM");
logisticsTurnover.setStorageLocation(location);
logisticsTurnover.setComDateTime(LocalDateTime.now());
logisticsTurnover.setIsReceive("N");
logisticsTurnover.setUser(user);
logisticsTurnover.setUserName(username);
logisticsTurnoverList.add(logisticsTurnover);
logisticsBill.setComTime(LocalDateTime.now());
logisticsBill.setLogisticsBillNo(transportno);
logisticsBill.setLogisticsBo(logisticsDto.getHandle());
logisticsBillService.save(logisticsBill);
logisticsBillList.add(logisticsBill);
}
return R.ok(logisticsTurnoverService.updateById(logisticsTurnover));
}else {
return R.failed();
if (logisticsBillService.saveBatch(logisticsBillList) && logisticsTurnoverService.updateBatchById(logisticsTurnoverList)) {
return R.ok();
}else {
return R.failed("转运出错");
}
} else {
return R.failed("转运出错");
}
}
}

@ -52,6 +52,27 @@ public class NwaUserController {
result = nwaUserService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("/login")
public R NwaUserLogin(NwaUser nwaUser){
List<NwaUser> result;
QueryWrapper<NwaUser> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(nwaUser);
result = nwaUserService.list(queryWrapper);
if (!result.isEmpty()){
return R.ok(result.get(0).toString());
}else {
return R.failed("登录失败");
}
}
/**
*

@ -20,6 +20,61 @@ public class LogisticsDto {
private String overOperation;
private String employeeDescription;
private String nextOperation;
private String status;
private String shopOrder;;
private String texture;
private String qtyToBuild;
private String zlDescription;
private String comfirmUser;
public String getComfirmUser() {
return comfirmUser;
}
public void setComfirmUser(String comfirmUser) {
this.comfirmUser = comfirmUser;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getZlDescription() {
return zlDescription;
}
public void setZlDescription(String zlDescription) {
this.zlDescription = zlDescription;
}
public String getShopOrder() {
return shopOrder;
}
public void setShopOrder(String shopOrder) {
this.shopOrder = shopOrder;
}
public String getTexture() {
return texture;
}
public void setTexture(String texture) {
this.texture = texture;
}
public String getQtyToBuild() {
return qtyToBuild;
}
public void setQtyToBuild(String qtyToBuild) {
this.qtyToBuild = qtyToBuild;
}
public String getNextWorkCenter() {
return nextWorkCenter;

@ -1,8 +1,11 @@
package com.foreverwin.mesnac.meapi.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.dto.LogisticsDto;
import com.foreverwin.mesnac.meapi.model.LogisticsTurnover;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.modular.core.util.FrontPage;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -13,12 +16,16 @@ import java.util.List;
* </p>
*
* @author YANG.WL
* @since 2022-07-27
* @since 2022-08-08
*/
@Repository
public interface LogisticsTurnoverMapper extends BaseMapper<LogisticsTurnover> {
List<LogisticsDto> queryLogisticsTurnoverList(LogisticsDto logisticsDto);
IPage<LogisticsDto> selectLogisticsDtoPage(FrontPage<LogisticsDto> frontPage, LogisticsDto logisticsDto);
List<LogisticsDto> queryLogisticsTurnoverList(@Param("HJHJ") String HJHJ,@Param("HJXL") String HJXL,@Param("JJ") String JJ,@Param("WX") String WX);
LogisticsTurnover queryNewtistTurnoverTask(String InspectionTaskNo);
List<LogisticsDto> selectlogisticsturnoverlist(LogisticsDto logisticsDto);
}

@ -4,6 +4,7 @@ import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
@ -15,7 +16,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
* </p>
*
* @author YANG.WL
* @since 2022-08-04
* @since 2022-08-08
*/
@TableName("Z_LOGISTICS_TURNOVER")
@ -27,7 +28,7 @@ public class LogisticsTurnover extends Model<LogisticsTurnover> {
/**
*
*/
@TableField("HANDLE")
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
@ -89,6 +90,27 @@ public class LogisticsTurnover extends Model<LogisticsTurnover> {
*/
@TableField("IS_RECEIVE")
private String isReceive;
/**
*
*/
@TableField("TURNOUT_WORKCENTER")
private String turnoutWorkcenter;
/**
*
*/
@TableField("TURNOUT_ITEM")
private String turnoutItem;
@TableField("OTHER4")
private LocalDateTime other4;
@TableField("OTHER5")
private String other5;
@TableField("OTHER6")
private String other6;
public String getHandle() {
@ -195,6 +217,46 @@ public class LogisticsTurnover extends Model<LogisticsTurnover> {
this.isReceive = isReceive;
}
public String getTurnoutWorkcenter() {
return turnoutWorkcenter;
}
public void setTurnoutWorkcenter(String turnoutWorkcenter) {
this.turnoutWorkcenter = turnoutWorkcenter;
}
public String getTurnoutItem() {
return turnoutItem;
}
public void setTurnoutItem(String turnoutItem) {
this.turnoutItem = turnoutItem;
}
public LocalDateTime getOther4() {
return other4;
}
public void setOther4(LocalDateTime other4) {
this.other4 = other4;
}
public String getOther5() {
return other5;
}
public void setOther5(String other5) {
this.other5 = other5;
}
public String getOther6() {
return other6;
}
public void setOther6(String other6) {
this.other6 = other6;
}
public static final String HANDLE = "HANDLE";
public static final String SFC_DISPATCH_BO = "SFC_DISPATCH_BO";
@ -221,6 +283,16 @@ public static final String COM_DATE_TIME = "COM_DATE_TIME";
public static final String IS_RECEIVE = "IS_RECEIVE";
public static final String TURNOUT_WORKCENTER = "TURNOUT_WORKCENTER";
public static final String TURNOUT_ITEM = "TURNOUT_ITEM";
public static final String OTHER4 = "OTHER4";
public static final String OTHER5 = "OTHER5";
public static final String OTHER6 = "OTHER6";
@Override
protected Serializable pkVal() {
@ -243,6 +315,11 @@ public static final String IS_RECEIVE = "IS_RECEIVE";
", turnoverWorkCenter = " + turnoverWorkCenter +
", comDateTime = " + comDateTime +
", isReceive = " + isReceive +
", turnoutWorkcenter = " + turnoutWorkcenter +
", turnoutItem = " + turnoutItem +
", other4 = " + other4 +
", other5 = " + other5 +
", other6 = " + other6 +
"}";
}
}

@ -66,6 +66,7 @@ public class NwaUser extends Model<NwaUser> {
private String email;
public String getHandle() {
return handle;
}

@ -14,7 +14,7 @@ import java.util.List;
* </p>
*
* @author YANG.WL
* @since 2022-07-27
* @since 2022-08-08
*/
public interface LogisticsTurnoverService extends IService<LogisticsTurnover> {
@ -27,10 +27,12 @@ public interface LogisticsTurnoverService extends IService<LogisticsTurnover> {
List<LogisticsTurnover> selectList(LogisticsTurnover logisticsTurnover);
List<LogisticsDto> queryLogisticsTurnoverList(LogisticsDto logisticsDto);
//根据派工单查最新的转运表数据
List<LogisticsDto> queryLogisticsTurnoverList(String HJHJ,String HJXL,String JJ,String WX);
LogisticsTurnover queryNewtistTurnoverTask(String InspectionTaskNo);
IPage<LogisticsDto> selectLogisticsDtoPage(FrontPage<LogisticsDto> frontPage, LogisticsDto logisticsDto);
List<LogisticsDto> selectlogisticsturnoverlist(LogisticsDto logisticsDto);
}

@ -19,7 +19,7 @@ import java.util.List;
* </p>
*
* @author YANG.WL
* @since 2022-07-27
* @since 2022-08-08
*/
@Service
@Transactional(rollbackFor = Exception.class)
@ -44,8 +44,8 @@ public class LogisticsTurnoverServiceImpl extends ServiceImpl<LogisticsTurnoverM
}
@Override
public List<LogisticsDto> queryLogisticsTurnoverList(LogisticsDto logisticsDto) {
return logisticsTurnoverMapper.queryLogisticsTurnoverList(logisticsDto);
public List<LogisticsDto> queryLogisticsTurnoverList(String HJHJ,String HJXL,String JJ,String WX) {
return logisticsTurnoverMapper.queryLogisticsTurnoverList(HJHJ,HJXL,JJ,WX);
}
@Override
@ -53,5 +53,15 @@ public class LogisticsTurnoverServiceImpl extends ServiceImpl<LogisticsTurnoverM
return logisticsTurnoverMapper.queryNewtistTurnoverTask(InspectionTaskNo);
}
@Override
public IPage<LogisticsDto> selectLogisticsDtoPage(FrontPage<LogisticsDto> frontPage, LogisticsDto logisticsDto) {
return logisticsTurnoverMapper.selectLogisticsDtoPage(frontPage,logisticsDto);
}
@Override
public List<LogisticsDto> selectlogisticsturnoverlist(LogisticsDto logisticsDto) {
return logisticsTurnoverMapper.selectlogisticsturnoverlist(logisticsDto);
}
}

@ -4,7 +4,7 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.meapi.model.LogisticsTurnover">
<result column="HANDLE" property="handle" />
<id column="HANDLE" property="handle" />
<result column="SFC_DISPATCH_BO" property="sfcDispatchBo" />
<result column="STATUS" property="status" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
@ -17,14 +17,33 @@
<result column="TURNOVER_WORK_CENTER" property="turnoverWorkCenter" />
<result column="COM_DATE_TIME" property="comDateTime" />
<result column="IS_RECEIVE" property="isReceive" />
<result column="TURNOUT_WORKCENTER" property="turnoutWorkcenter" />
<result column="TURNOUT_ITEM" property="turnoutItem" />
<result column="OTHER4" property="other4" />
<result column="OTHER5" property="other5" />
<result column="OTHER6" property="other6" />
<result column="NEXT_WORK_CENTER" property="nextWorkcenter" />
<result column="SHOP_ORDER" property="shopOrder" />
<result column="SFC" property="sfc" />
<result column="WORK_ORDER" property="workOrder" />
<result column="ITEM_DESC" property="itemdesc" />
<result column="ITEM_DESC" property="itemdesc" />
<result column="TEXTURE" property="texture" />
<result column="BLANKING_SIZE" property="blankingSize" />
<result column="QTY_TO_BUILD" property="qtyToBuild" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SFC_DISPATCH_BO, STATUS, CREATED_DATE_TIME, USER, USER_NAME, OTHER1, OTHER2, OTHER3, STORAGE_LOCATION, TURNOVER_WORK_CENTER, COM_DATE_TIME, IS_RECEIVE
HANDLE, SFC_DISPATCH_BO, STATUS, CREATED_DATE_TIME, USER, USER_NAME, OTHER1, OTHER2, OTHER3, STORAGE_LOCATION, TURNOVER_WORK_CENTER, COM_DATE_TIME, IS_RECEIVE, TURNOUT_WORKCENTER, TURNOUT_ITEM, OTHER4, OTHER5, OTHER6
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_LOGISTICS_TURNOVER WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
@ -40,6 +59,12 @@
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_LOGISTICS_TURNOVER WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_LOGISTICS_TURNOVER
@ -59,6 +84,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</where>
</select>
@ -82,6 +112,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -113,6 +148,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -144,6 +184,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -175,6 +220,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -186,8 +236,24 @@
</if>
</select>
<sql id="Select_LogisticsTurnover_List">
ZLT.HANDLE
WCT.DESCRIPTION NEXT_WORK_CENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
OT.DESCRIPTION NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION,
ZLT.TURNOVER_WORK_CENTER,
ZLT.CREATED_DATE_TIME
</sql>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_LOGISTICS_TURNOVER
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_LOGISTICS_TURNOVER ZLT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
@ -206,6 +272,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -237,6 +308,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -264,6 +340,11 @@
<if test="turnoverWorkCenter!=null">TURNOVER_WORK_CENTER,</if>
<if test="comDateTime!=null">COM_DATE_TIME,</if>
<if test="isReceive!=null">IS_RECEIVE,</if>
<if test="turnoutWorkcenter!=null">TURNOUT_WORKCENTER,</if>
<if test="turnoutItem!=null">TURNOUT_ITEM,</if>
<if test="other4!=null">OTHER4,</if>
<if test="other5!=null">OTHER5,</if>
<if test="other6!=null">OTHER6,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
@ -279,6 +360,11 @@
<if test="turnoverWorkCenter!=null">#{turnoverWorkCenter},</if>
<if test="comDateTime!=null">#{comDateTime},</if>
<if test="isReceive!=null">#{isReceive},</if>
<if test="turnoutWorkcenter!=null">#{turnoutWorkcenter},</if>
<if test="turnoutItem!=null">#{turnoutItem},</if>
<if test="other4!=null">#{other4},</if>
<if test="other5!=null">#{other5},</if>
<if test="other6!=null">#{other6},</if>
</trim>
</insert>
@ -301,17 +387,63 @@
#{turnoverWorkCenter},
#{comDateTime},
#{isReceive},
#{turnoutWorkcenter},
#{turnoutItem},
#{other4},
#{other5},
#{other6},
</trim>
</insert>
<update id="updateById">
UPDATE Z_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.user!=null">USER=#{et.user},</if>
<if test="et.userName!=null">USER_NAME=#{et.userName},</if>
<if test="et.other1!=null">OTHER1=#{et.other1},</if>
<if test="et.other2!=null">OTHER2=#{et.other2},</if>
<if test="et.other3!=null">OTHER3=#{et.other3},</if>
<if test="et.storageLocation!=null">STORAGE_LOCATION=#{et.storageLocation},</if>
<if test="et.turnoverWorkCenter!=null">TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},</if>
<if test="et.comDateTime!=null">COM_DATE_TIME=#{et.comDateTime},</if>
<if test="et.isReceive!=null">IS_RECEIVE=#{et.isReceive},</if>
<if test="et.turnoutWorkcenter!=null">TURNOUT_WORKCENTER=#{et.turnoutWorkcenter},</if>
<if test="et.turnoutItem!=null">TURNOUT_ITEM=#{et.turnoutItem},</if>
<if test="et.other4!=null">OTHER4=#{et.other4},</if>
<if test="et.other5!=null">OTHER5=#{et.other5},</if>
<if test="et.other6!=null">OTHER6=#{et.other6},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
SFC_DISPATCH_BO=#{et.sfcDispatchBo},
STATUS=#{et.status},
CREATED_DATE_TIME=#{et.createdDateTime},
USER=#{et.user},
USER_NAME=#{et.userName},
OTHER1=#{et.other1},
OTHER2=#{et.other2},
OTHER3=#{et.other3},
STORAGE_LOCATION=#{et.storageLocation},
TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},
COM_DATE_TIME=#{et.comDateTime},
IS_RECEIVE=#{et.isReceive},
TURNOUT_WORKCENTER=#{et.turnoutWorkcenter},
TURNOUT_ITEM=#{et.turnoutItem},
OTHER4=#{et.other4},
OTHER5=#{et.other5},
OTHER6=#{et.other6},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_LOGISTICS_TURNOVER <trim prefix="SET" suffixOverrides=",">
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
<if test="et.sfcDispatchBo!=null">SFC_DISPATCH_BO=#{et.sfcDispatchBo},</if>
<if test="et.status!=null">STATUS=#{et.status},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
@ -324,6 +456,11 @@
<if test="et.turnoverWorkCenter!=null">TURNOVER_WORK_CENTER=#{et.turnoverWorkCenter},</if>
<if test="et.comDateTime!=null">COM_DATE_TIME=#{et.comDateTime},</if>
<if test="et.isReceive!=null">IS_RECEIVE=#{et.isReceive},</if>
<if test="et.turnoutWorkcenter!=null">TURNOUT_WORKCENTER=#{et.turnoutWorkcenter},</if>
<if test="et.turnoutItem!=null">TURNOUT_ITEM=#{et.turnoutItem},</if>
<if test="et.other4!=null">OTHER4=#{et.other4},</if>
<if test="et.other5!=null">OTHER5=#{et.other5},</if>
<if test="et.other6!=null">OTHER6=#{et.other6},</if>
</trim>
<where>
<if test="ew!=null">
@ -341,6 +478,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -352,6 +494,9 @@
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_LOGISTICS_TURNOVER WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_LOGISTICS_TURNOVER
@ -386,6 +531,11 @@
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
@ -397,6 +547,12 @@
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_LOGISTICS_TURNOVER WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
<!-- BaseMapper标准查询/修改/删除 -->
<select id="queryNewtistTurnoverTask" resultType="com.foreverwin.mesnac.meapi.model.LogisticsTurnover">
@ -421,7 +577,9 @@
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
OT.DESCRIPTION NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION
ZSD.EMPLOYEE_DESCRIPTION,
ZLT.TURNOVER_WORK_CENTER,
ZLT.CREATED_DATE_TIME
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
@ -444,7 +602,133 @@
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.LOCALE = 'zh'
WHERE ZLT.STATUS = 'NEW'
</select>
<if test="HJHJ!=null"> AND ZLT.TURNOUT_ITEM like '02%' AND ZLT.TURNOUT_WORKCENTER = 'HJ' </if>
<if test="HJXL!=null"> AND ZLT.TURNOUT_ITEM like '03%' AND ZLT.TURNOUT_WORKCENTER = 'HJ' </if>
<if test="JJ!=null">AND ZLT.TURNOUT_WORKCENTER = 'JJ' </if>
<if test="WX!=null">AND ZLT.TURNOUT_WORKCENTER = 'WX' </if>
GROUP BY WCT.DESCRIPTION,
ZSD.SFC,
C1.VALUE,
IT.DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION,
OT.DESCRIPTION,
ZSD.EMPLOYEE_DESCRIPTION,
ZLT.TURNOVER_WORK_CENTER,
ZLT.CREATED_DATE_TIME
ORDER BY ZLT.CREATED_DATE_TIME DESC
</select>
<sql id="Select_LogisticsTurnOver_List">
WCT.DESCRIPTION NEXT_WORK_CENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
OT.DESCRIPTION NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION,
ZLT.TURNOVER_WORK_CENTER,
ZLT.CREATED_DATE_TIME
</sql>
<select id="selectLogisticsDtoPage" resultType="com.foreverwin.mesnac.meapi.dto.LogisticsDto">
SELECT <include refid="Select_LogisticsTurnOver_List"></include> FROM Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZLT.SFC_DISPATCH_BO = ZSD.HANDLE
LEFT JOIN OPERATION O1 ON O1.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT1 ON OT1.OPERATION_BO = O1.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZLT.OTHER1
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE
AND SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE
AND C1."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = ZSD.SITE
AND O.OPERATION = ZSD.OPERATION
AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.LOCALE = 'zh'
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<if test="ew.entity.status!=null"> AND STATUS=#{ew.entity.status}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.user!=null"> AND USER=#{ew.entity.user}</if>
<if test="ew.entity.userName!=null"> AND USER_NAME=#{ew.entity.userName}</if>
<if test="ew.entity.other1!=null"> AND OTHER1=#{ew.entity.other1}</if>
<if test="ew.entity.other2!=null"> AND OTHER2=#{ew.entity.other2}</if>
<if test="ew.entity.other3!=null"> AND OTHER3=#{ew.entity.other3}</if>
<if test="ew.entity.storageLocation!=null"> AND STORAGE_LOCATION=#{ew.entity.storageLocation}</if>
<if test="ew.entity.turnoverWorkCenter!=null"> AND TURNOVER_WORK_CENTER=#{ew.entity.turnoverWorkCenter}</if>
<if test="ew.entity.comDateTime!=null"> AND COM_DATE_TIME=#{ew.entity.comDateTime}</if>
<if test="ew.entity.isReceive!=null"> AND IS_RECEIVE=#{ew.entity.isReceive}</if>
<if test="ew.entity.turnoutWorkcenter!=null"> AND TURNOUT_WORKCENTER=#{ew.entity.turnoutWorkcenter}</if>
<if test="ew.entity.turnoutItem!=null"> AND TURNOUT_ITEM=#{ew.entity.turnoutItem}</if>
<if test="ew.entity.other4!=null"> AND OTHER4=#{ew.entity.other4}</if>
<if test="ew.entity.other5!=null"> AND OTHER5=#{ew.entity.other5}</if>
<if test="ew.entity.other6!=null"> AND OTHER6=#{ew.entity.other6}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectlogisticsturnoverlist" resultType="com.foreverwin.mesnac.meapi.dto.LogisticsDto">
SELECT
WCT.DESCRIPTION NEXT_WORK_CENTER,
ZSD.SFC,
C1.VALUE WORK_ORDER,
IT.DESCRIPTION ITEM_DESCRIPTION,
ZSD.BLANKING_SIZE,
ZSD.DISPATCH_QTY,
OT1.DESCRIPTION OVER_OPERATION,
OT.DESCRIPTION NEXT_OPERATION,
ZSD.EMPLOYEE_DESCRIPTION,
ZLT.TURNOVER_WORK_CENTER,
ZLT.CREATED_DATE_TIME,
C2.VALUE TEXTURE,
SO.QTY_TO_BUILD,
SO.SHOP_ORDER,
ZL.DESCRIPTION ZL_DESCRIPTION,
CASE WHEN ZLT.STATUS = 'NEW' THEN '待转运' ELSE '转运完成' END STATUS,
ZLT.OTHER5 COMFIRM_USER
FROM
Z_LOGISTICS_TURNOVER ZLT
LEFT JOIN WORK_CENTER WC ON WC.WORK_CENTER = ZLT.TURNOVER_WORK_CENTER
LEFT JOIN WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WC.HANDLE
LEFT JOIN Z_SFC_DISPATCH ZSD ON ZLT.SFC_DISPATCH_BO = ZSD.HANDLE
LEFT JOIN OPERATION O1 ON O1.OPERATION = ZSD.OPERATION
LEFT JOIN OPERATION_T OT1 ON OT1.OPERATION_BO = O1.HANDLE
LEFT JOIN OPERATION O ON O.OPERATION = ZLT.OTHER1
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
LEFT JOIN Z_LOCATION ZL ON ZL.LOCATION_CODE = ZLT.STORAGE_LOCATION
INNER JOIN SHOP_ORDER SO ON SO.SITE = ZSD.SITE
AND SO.SHOP_ORDER = ZSD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE
AND C1."ATTRIBUTE" = 'WORK_ORDER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN CUSTOM_FIELDS C2 ON C2.HANDLE = IM.HANDLE AND C2.ATTRIBUTE = 'TEXTTURE'
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE
AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = ZSD.SITE
AND O.OPERATION = ZSD.OPERATION
AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE
AND OT.LOCALE = 'zh'
</select>
</mapper>

@ -463,6 +463,30 @@ public class PodTemplateServiceImpl implements PodTemplateService {
//更改派工单状态
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), dispatchNo, DispatchStatusEnum.COMPLETE.getCode(),workHour);
QueryWrapper<SfcDispatch> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(SfcDispatch.SFC,sfcDispatchById.getSfc());
queryWrapper.eq(SfcDispatch.SHOP_ORDER,sfcDispatchById.getShopOrder());
queryWrapper.eq(SfcDispatch.DISPATCH_SEQ,String.valueOf(Integer.parseInt(sfcDispatchById.getDispatchSeq())+1));
SfcDispatch sfcDispatch=sfcDispatchService.getOne(queryWrapper);
if (sfcDispatch!=null && sfcDispatch.getOperation().equals("HJ_6106JYGX")){
Operation nextcurrentRevisionRef = operationService.getCurrentRevisionRef(site, sfcDispatch.getOperation());
BigDecimal workHours=BigDecimal.ZERO;
sfcCrossService.completeAction(site, nextcurrentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), sfcDispatch.getDispatchNo(), DispatchStatusEnum.COMPLETE.getCode(),workHours);
}
if (sfcDispatch!=null && sfcDispatch.getOperation().equals("HJ_6106JRGX")){
Operation nextcurrentRevisionRef = operationService.getCurrentRevisionRef(site, sfcDispatch.getOperation());
BigDecimal workHours=BigDecimal.ZERO;
sfcCrossService.completeAction(site, nextcurrentRevisionRef.getHandle(), resrce, sfcServiceById.getHandle(), qty);
sfcDispatchCommonService.updateSfcDispatchStatus(site, CommonMethods.getUser(), sfcDispatch.getDispatchNo(), DispatchStatusEnum.COMPLETE.getCode(),workHours);
SfcDispatchDto sfcdispatchs = new SfcDispatchDto();
sfcdispatchs.setHandle(HandleEnum.SFC_DISPATCH.getHandle(site, sfcDispatch.getHandle()));
sfcdispatchs = sfcDispatchCommonService.findSfcDispatchBySfc(sfcdispatchs);
sendErp(sfc, stepId, qty, BigDecimal.ZERO, qty.multiply(sfcdispatchs.getProdHours()));
}
/**
*
*/
@ -486,6 +510,8 @@ public class PodTemplateServiceImpl implements PodTemplateService {
integrationLogService.saveIntegrationLog(log);
}
//报工
if (enabled&&falg){
SfcDispatchDto sfcdispatch = new SfcDispatchDto();

@ -234,9 +234,30 @@ public class InspectionTaskManageServiceImpl implements InspectionTaskManageServ
logisticsTurnover.setOther2(inspectionTaskModel.getStepId());
logisticsTurnover.setOther3(inspectionTaskModel.getHandle());
logisticsTurnover.setTurnoverWorkCenter(sfcDispatch.getWorkCenter());
logisticsTurnover.setTurnoutItem(inspectionTaskManage.getItem());
logisticsTurnover.setTurnoutWorkcenter(inspectionTaskManage.getWorkCenter());
logisticsTurnoverService.save(logisticsTurnover);
}
else {
//判断此工序是否需要转入半成品库位
if (Constants.RK.equals(sfcDispatchById.getOther2())){
LogisticsTurnover logisticsTurnover=new LogisticsTurnover();
logisticsTurnover.setHandle("LogisticsBO:1000"+","+UUID.randomUUID().toString());
logisticsTurnover.setSfcDispatchBo(inspectionTaskModel.getSfcDispatchBo());
logisticsTurnover.setStatus(Constants.LOGISTICS_NEW);
logisticsTurnover.setCreatedDateTime(LocalDateTime.now());
logisticsTurnover.setOther1(sfcDispatchById.getOperation());
logisticsTurnover.setOther2(inspectionTaskModel.getStepId());
logisticsTurnover.setOther3(inspectionTaskModel.getHandle());
logisticsTurnover.setTurnoverWorkCenter(sfcDispatchById.getWorkCenter());
logisticsTurnover.setTurnoutItem(inspectionTaskManage.getItem());
logisticsTurnover.setTurnoutWorkcenter(inspectionTaskManage.getWorkCenter());
logisticsTurnoverService.save(logisticsTurnover);
}
}
}

Loading…
Cancel
Save