10/31 工位分格1.0

panjc_field_management
wangwei 8 months ago
parent 1f92ad7a9a
commit b11c7b3d1b

@ -1,22 +1,38 @@
package com.glxp.api.controller.auth;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.SysWorkplace;
import com.glxp.api.entity.basic.SysWorkplaceQueue;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity;
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.req.basic.SysWorkplaceQueueRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.SysWorkplaceResponse;
import com.glxp.api.service.auth.SysWorkplaceService;
import com.glxp.api.service.basic.SysWorkplaceQueueService;
import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.util.JasperUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author : zhangsan
@ -32,6 +48,16 @@ public class SysWorkplaceQueueController extends BaseController {
@Resource
SysWorkplaceQueueService sysWorkplaceQueueService;
@Resource
private SystemPDFModuleService systemPDFModuleService;
@Resource
private SystemPDFTemplateService systemPDFTemplateService;
@Value("${file_path}")
private String filePath;
@Resource
SysWorkplaceService sysWorkplaceService;
@GetMapping("/udiwms/sysWorkplaceQueue/page")
public BaseResponse page(SysWorkplaceQueueRequest request) {
List<SysWorkplaceQueue> page = sysWorkplaceQueueService.filterList(request);
@ -81,5 +107,36 @@ public class SysWorkplaceQueueController extends BaseController {
String code = sysWorkplaceQueueService.createQueueCode();
return ResultVOUtils.success(code);
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/sysWorkplaceQueue/label/print")
public BaseResponse printLabel(@RequestBody SysWorkplaceQueue sysWorkplaceQueue, HttpServletRequest request, HttpServletResponse response) throws Exception {
SysPdfTemplateRelevanceLabelEntity sysPdfTemplateRelevanceLabelEntity = systemPDFModuleService.selectByLabelId(sysWorkplaceQueue.getLabelId() + "");
if (null == sysPdfTemplateRelevanceLabelEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
}
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceLabelEntity.getTemplateId()));
if (null == systemPDFTemplateEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
}
SysWorkplace workplace = sysWorkplaceService.getWorkplace(sysWorkplaceQueue.getWorkPlaceIdFk());
//打印单号标签
Map<String, Object> data = new HashMap<>(1);
Map<String, Object> supData = new HashMap<>();
supData.put("name", sysWorkplaceQueue.getName() + "");
supData.put("code", sysWorkplaceQueue.getCode());
supData.put("workplaceName", workplace.getWorkplaceName());
// supData.put("remake", sysWorkplace.getRemake() == null ? ' ' : sysWorkplace.getRemake());
// supData.put("qrCode", "{\"DMHotskey\":{\"workPlace\":" + sysWorkplace.getWorkplaceId() + "}}");
data.put("data", supData);
String param = JSON.toJSONString(data);
log.error(param);
JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
}
}

@ -64,5 +64,8 @@ public class SysWorkplaceQueue implements Serializable {
@ApiModelProperty(value = "")
private String updateUser;
@TableField(exist = false)
private String labelId;
private static final long serialVersionUID = 1L;
}

@ -34,12 +34,18 @@ public class SysWorkplaceQueueService extends ServiceImpl<SysWorkplaceQueueMappe
}
public String createQueueCode() {
Long s = IdUtil.getSnowflakeNextId();
long eightDigitId = s % 100000000;
String code = "DM" + eightDigitId;
SysWorkplaceQueue sysWorkplaceQueue = sysWorkplaceQueueMapper.selectOne(new LambdaQueryWrapper<SysWorkplaceQueue>().eq(SysWorkplaceQueue::getCode, code));
if (sysWorkplaceQueue != null){
this.createQueueCode();
String code;
SysWorkplaceQueue sysWorkplaceQueue = sysWorkplaceQueueMapper.selectOne(new LambdaQueryWrapper<SysWorkplaceQueue>().orderByDesc(SysWorkplaceQueue::getCode).last("LIMIT 1"));
if (sysWorkplaceQueue == null){
//没有数据 新增
code = "DMQ00000" + 1;
}else {
String code1 = sysWorkplaceQueue.getCode();
String withoutDMQ = code1.replace("DMQ", "");
Integer result = Integer.parseInt(withoutDMQ.trim());
result += 1;
String sixDigitResult = String.format("%06d", result);
code = "DMQ" + sixDigitResult;
}
return code;
}
@ -57,4 +63,5 @@ public class SysWorkplaceQueueService extends ServiceImpl<SysWorkplaceQueueMappe
}
}

@ -421,8 +421,10 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC
List<IoOrderResponse> list = orderService.filterList(filterOrderRequest);
PageInfo<IoOrderResponse> pageInfo = new PageInfo<>(list);
int removedCount = 0; // 用于记录移除的元素数量
for (IoOrderResponse ioOrderEntity : list) {
if (collectOrderMapper.exists(new LambdaQueryWrapper<IoCollectOrder>().eq(IoCollectOrder::getBillNo, ioOrderEntity.getBillNo()))) {
removedCount++;
continue;
}
SysWorkplaceDocumentEntity sysWorkplaceDocumentEntity = sysWorkplaceDocumentService.findByBusType(ioOrderEntity.getAction());
@ -487,6 +489,8 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC
}
PageInfo<IoCollectOrder> pageInfoReturn = new PageInfo<>(ioCollectOrders);
int newTotal = Math.toIntExact(pageInfo.getTotal() - removedCount);
pageInfo.setTotal(newTotal);
BeanUtils.copyProperties(pageInfo, pageInfoReturn);
pageInfoReturn.setList(ioCollectOrders);
return ResultVOUtils.success(pageInfoReturn);

@ -254,9 +254,9 @@ public class HeartService {
String taskId = CustomUtil.getId();
switch (exportType) {
case BASIC_DATA:
// if (needExec(info.getBasicProducts(), info.getBasicCorp(), info.getSupCert())) {
// uploadData(exportType, taskId, x -> x.getBasicData(info, taskId, now, syncTime));
// }
if (needExec(info.getBasicProducts(), info.getBasicCorp(), info.getSupCert())) {
uploadData(exportType, taskId, x -> x.getBasicData(info, taskId, now, syncTime));
}
break;
case OTHER_DATA:
// if (needExec(info.getUdiCodeLost(), info.getUdiCodeRel())) {

@ -64,11 +64,6 @@
'%'
)
</if>
<if test="busType != null and busType != ''">
AND busType
=
#{busType}
</if>
<if test="fromCorp != '' and fromCorp != null">
AND (
fromCorp
@ -104,7 +99,7 @@
AND ico.fromCorpName LIKE concat('%', #{fromCorpName}, '%')
</if>
<if test="busType != null and busType != ''">
AND busType = #{busType}
AND ico.busType = #{busType}
</if>
<if test="tagStatus != null">
AND tagStatus = #{tagStatus}

Loading…
Cancel
Save