|
|
|
@ -16,6 +16,7 @@ import com.glxp.api.entity.system.SystemPDFTemplateEntity;
|
|
|
|
|
import com.glxp.api.exception.JsonException;
|
|
|
|
|
import com.glxp.api.req.auth.SysWorkplaceRequest;
|
|
|
|
|
import com.glxp.api.req.dev.DeviceInfoDetailQuery;
|
|
|
|
|
import com.glxp.api.req.system.PrintLabelRequest;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.service.auth.SysWorkplaceService;
|
|
|
|
|
import com.glxp.api.service.system.SystemPDFModuleService;
|
|
|
|
@ -31,10 +32,7 @@ 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;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author : zhuzhu
|
|
|
|
@ -141,5 +139,47 @@ public class SysWorkplaceController extends BaseController {
|
|
|
|
|
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* {"DMHotskey":{"workPlace": 60011001}}
|
|
|
|
|
* {"DMHotskey":{"splitBusType": "SC72197936495755"}}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 打印拆零标签
|
|
|
|
|
*/
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/udiwms/split/label/print")
|
|
|
|
|
public BaseResponse printSplitLabel(@RequestBody PrintLabelRequest printLabelRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
|
|
|
|
|
|
|
SysPdfTemplateRelevanceLabelEntity sysPdfTemplateRelevanceLabelEntity = systemPDFModuleService.selectByLabelId(printLabelRequest.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, "模板错误");
|
|
|
|
|
}
|
|
|
|
|
//打印单号标签
|
|
|
|
|
Map<String, Object> data = new HashMap<>(1);
|
|
|
|
|
List<Object> list = new ArrayList<>();
|
|
|
|
|
Map<String, Object> supData = new HashMap<>();
|
|
|
|
|
supData.put("title", "拆零上货");
|
|
|
|
|
supData.put("qrCode", "{\"DMHotskey\":{\"fifoSplit\": 1}}");
|
|
|
|
|
|
|
|
|
|
Map<String, Object> supData2 = new HashMap<>();
|
|
|
|
|
supData2.put("title", "整取上货");
|
|
|
|
|
supData2.put("qrCode", "{\"DMHotskey\":{\"fifoSplit\": 2}}");
|
|
|
|
|
|
|
|
|
|
list.add(supData);
|
|
|
|
|
list.add(supData2);
|
|
|
|
|
data.put("data", list);
|
|
|
|
|
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, "模板错误");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|