作者 朱兆平

运单未放行指令记录优化

package com.sy.service;
import com.sy.model.GatherInfo;
import com.sy.model.LAND_BUSINEESTYPE_LIST_INFO;
import com.sy.model.LandBusinessTypeList;
import com.sy.model.commandLog;
import java.util.List;
public interface CommandLogService {
int insert(commandLog command);
/**
* 根据进出场信息写入日志
* @param info 过卡信息
* @param check 过卡状态
* @param reason 抬杆指令内容
* @param land 流转申请信息
* @param listInfos 流转单列表
* @param selfWt 车辆备案重量
* @param inWt 车辆入场重量
* @param goodsWt 车辆装载货物重量
* @param diffVal 进出场差值
*/
public void commandlog(GatherInfo info, boolean check, String reason, LandBusinessTypeList land, List<LAND_BUSINEESTYPE_LIST_INFO> listInfos,
Double selfWt,Double inWt,Double goodsWt,Double diffVal
);
}
... ...
package com.sy.service.impl;
import com.sy.mapper.commandLogMapper;
import com.sy.model.GatherInfo;
import com.sy.model.LAND_BUSINEESTYPE_LIST_INFO;
import com.sy.model.LandBusinessTypeList;
import com.sy.model.commandLog;
import com.sy.service.CommandLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import static com.sy.service.impl.ResMessageServiceImpl.toStrArry;
@Service
public class CommandLogImpl implements CommandLogService {
@Autowired
@Resource
commandLogMapper mapper;
@Override
public int insert(commandLog command) {
return mapper.insertSelective(command);
}
@Override
public void commandlog(GatherInfo info, boolean check, String reason, LandBusinessTypeList land, List<LAND_BUSINEESTYPE_LIST_INFO> list_infos,
Double selfWt,Double inWt,Double goodsWt,Double diffVal
){
String flag="",type="";
commandLog command=new commandLog();
command.setId(UUID.randomUUID().toString());
command.setBarcode(info.getBarcode());
if(land!=null){
command.setBusnessType(land.getBusinesstype());
}
command.setAreaId(info.getAreaid());
command.setChnlNo(info.getChnlno());
if (check){
flag = "00";
} else{
flag = "11";
}
if("I".equals(info.getIetype())){
type="000000200000000000";
}else{
type="000000100000000000";
}
command.setReasonCode(flag+type);
command.setReasonText(reason);
command.setVeName(info.getVename());
command.setVeWeight(selfWt);
command.setIeType(info.getIetype());
command.setExitGrossWeight(info.getGrosswt().doubleValue());
command.setInGrossWeight(inWt);
command.setGoodsWeight(goodsWt);
command.setActualGoodsWeight(diffVal);
if(list_infos.size()>0){
command.setMasterList(Arrays.toString(toStrArry(list_infos)));
}
insert(command);
}
}
... ...
... ... @@ -4,6 +4,7 @@ import com.sy.mapper.RESMESSAGEMapper;
import com.sy.model.GatherInfo;
import com.sy.model.LAND_BUSINEESTYPE_LIST_INFO;
import com.sy.model.RESMESSAGE;
import com.sy.service.CommandLogService;
import com.sy.service.ResMessageService;
import com.sy.socket.CommandClient;
import org.apache.log4j.Logger;
... ... @@ -27,6 +28,9 @@ public class ResMessageServiceImpl implements ResMessageService {
@Autowired
private RESMESSAGEMapper mapper;
@Autowired
CommandLogService commandLogService;
@Override
public int saveEnter(RESMESSAGE resmessage){
... ... @@ -71,6 +75,8 @@ public class ResMessageServiceImpl implements ResMessageService {
}
if (!noRelease.isEmpty()) {
logger.info(Arrays.toString(noRelease.toArray())+FANGXING);
commandLogService.commandlog(info,false,Arrays.toString(noRelease.toArray())+FANGXING,null,list_infos,
new Double("0.0"),new Double("0.0"),new Double("0.0"),new Double("0.0"));
CommandClient.Client(info, Arrays.toString(noRelease.toArray())+FANGXING);
}
}
... ...