xiaoning 1 year ago
parent 1a52ee77f5
commit b8b195f0c9

@ -79,6 +79,8 @@ public class DmDhqdp implements Serializable {
@ApiModelProperty(value = "备注")
private String bz;
private String drr;
private String drrq;
@ApiModelProperty(value = "状态; 0编辑1提交2审核默认为0")
private String zt;

@ -57,7 +57,7 @@ public class DmJtsyjh implements Serializable {
private String bzrq;
@ApiModelProperty(value = "状态; 0未提交1已提交默认为0")
private String zt;
private String zt="0";
@Id
@TableId(value = "xh", type = IdType.ASSIGN_UUID)

@ -201,13 +201,13 @@ public class DmSygd implements Serializable {
private String n8gxSj;
@ApiModelProperty(value = "7跨型板小组")
private Double x7xx;
private int x7xx;
@ApiModelProperty(value = "加工时间")
private String x7xxSj;
@ApiModelProperty(value = "7跨型板大组")
private Double x7xd;
private int x7xd;
@ApiModelProperty(value = "加工时间")
private String x7xdSj;

@ -68,6 +68,9 @@ public class DmSygdMx implements Serializable {
@ApiModelProperty(value = "组立")
private String zl;
@ApiModelProperty(value = "钢加大组结束")
private String gjjsDz;
@ApiModelProperty(value = "加工类型")
private String lx;
@ -184,6 +187,7 @@ public class DmSygdMx implements Serializable {
private BigDecimal qgs;//曲加工总工时
private BigDecimal zpgs;//装配总工时
private String xxr;
@TableField(exist = false)
private String beginTime;
@TableField(exist = false)

@ -3,6 +3,7 @@ package com.dsic.gj_erp.bean.jhgk.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -26,176 +27,294 @@ public class SyExcel implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "产品")
@ApiModelProperty(value = "船号")
@ExcelProperty(index = 1)
private String dcCh1;
private String dcCh;
@ApiModelProperty(value = "目标船只")
@ExcelProperty(index = 2)
private String dcCh2;
@ApiModelProperty(value = "本船只")
@ApiModelProperty(value = "分段号")
@ExcelProperty(index = 3)
private String dcCh3;
private String dcFd;
@ApiModelProperty(value = "批量")
@ExcelProperty(index = 4)
@ApiModelProperty(value = "批量号")
@ExcelProperty(index = 2)
private String dcPl;
@ApiModelProperty(value = "分段")
@ApiModelProperty(value = "钢加大组结束")
@ExcelProperty(index = 4)
private String gjjsDz;
@ApiModelProperty(value = "钢加小组结束")
@ExcelProperty(index = 5)
private String dcFd;
private String gjjsXz;
@ApiModelProperty(value = "板数")
@ApiModelProperty(value = "套料图接收")
@ExcelProperty(index = 6)
private Double bs;
private String jsqTlt;
@ApiModelProperty(value = "到货数量")
@ApiModelProperty(value = "板材领取表接收")
@ExcelProperty(index = 7)
private Double dhsl;
private String jsqLqb;
@ApiModelProperty(value = "在途数量")
@ApiModelProperty(value = "订货清单号")
@ExcelProperty(index = 8)
private Double ztsl;
private String dhqd;
@ApiModelProperty(value = "生产下发期")
@ApiModelProperty(value = "状态0编辑 1提交 2审核 3下发 4完成 5拖期")
@ExcelProperty(index = 9)
@DateTimeFormat("yyyy/MM/dd")
private String scxfq;
private String gdZt;
@ApiModelProperty(value = "型材抛丸")
@ApiModelProperty(value = "订货板数")
@ExcelProperty(index = 10)
private String xcpw;
private Double orderBs;
@ApiModelProperty(value = "数")
@ApiModelProperty(value = "到货板数")
@ExcelProperty(index = 11)
private Double gs;
private Double arrivalBs;
@ApiModelProperty(value = "抛丸")
@ApiModelProperty(value = "套料图板数")
@ExcelProperty(index = 12)
private String pw;
private int tltSl;
@ApiModelProperty(value = "坡口切割结束")
@ApiModelProperty(value = "上料张数")
@ExcelProperty(index = 13)
@DateTimeFormat("yyyy/MM/dd")
private String pkjs1;
private int slSl;
@ApiModelProperty(value = "二垮数控板数")
@ApiModelProperty(value = "上料时间")
@ExcelProperty(index = 14)
private String skbs1;
private String slSj;
@ApiModelProperty(value = "数控切割开始")
@ApiModelProperty(value = "抛丸数量")
@ExcelProperty(index = 15)
@DateTimeFormat("yyyy/MM/dd")
private String skks1;
private int pwSl;
@ApiModelProperty(value = "坡口长度")
@ApiModelProperty(value = "抛丸时间")
@ExcelProperty(index = 16)
private Double pkcd1;
private String pwSj;
@ApiModelProperty(value = "坡口切割结束")
@ApiModelProperty(value = "型材抛丸")
@ExcelProperty(index = 17)
@DateTimeFormat("yyyy/MM/dd")
private String pkjs2;
private Double xcpwSl;
@ApiModelProperty(value = "三垮数控板数")
@ApiModelProperty(value = "型材抛丸时间")
@ExcelProperty(index = 18)
private String skbs2;
private String xcpwSj;
@ApiModelProperty(value = "数控切割开始")
@ApiModelProperty(value = "1跨平直大板大组")
@ExcelProperty(index = 19)
@DateTimeFormat("yyyy/MM/dd")
private String skks2;
private int n1ad;
@ApiModelProperty(value = "坡口长度")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 20)
private Double pkcd2;
private String n1adSj;
@ApiModelProperty(value = "坡口切割结束")
@ApiModelProperty(value = "1跨平直大板小组")
@ExcelProperty(index = 21)
@DateTimeFormat("yyyy/MM/dd")
private String pkjs3;
private int n1ax;
@ApiModelProperty(value = "三垮平铁板数")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 22)
private String ptbs;
private String n1axSj;
@ApiModelProperty(value = "平铁切割开始")
@ApiModelProperty(value = "1跨进线板大组")
@ExcelProperty(index = 23)
@DateTimeFormat("yyyy/MM/dd")
private String ptks;
private int n1ld;
@ApiModelProperty(value = "平铁切割结束")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 24)
@DateTimeFormat("yyyy/MM/dd")
private String ptjs;
private String n1ldSj;
@ApiModelProperty(value = "曲平铁转结束")
@ApiModelProperty(value = "2跨超长超宽板大组")
@ExcelProperty(index = 25)
@DateTimeFormat("yyyy/MM/dd")
private String qptzjs;
private int n2bd;
@ApiModelProperty(value = "曲平铁结束")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 26)
@DateTimeFormat("yyyy/MM/dd")
private String qptjs;
private String n2bdSj;
@ApiModelProperty(value = "曲外板结束")
@ApiModelProperty(value = "2跨超长超宽板小组")
@ExcelProperty(index = 27)
@DateTimeFormat("yyyy/MM/dd")
private String qwbjs;
private int n2bx;
@ApiModelProperty(value = "组立")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 28)
@DateTimeFormat("yyyy/MM/dd")
private String zl;
private String n2bxSj;
@ApiModelProperty(value = "数控板数")
@ApiModelProperty(value = "2跨超长超宽曲板小组")
@ExcelProperty(index = 29)
private String skbs3;
private int n2cx;
@ApiModelProperty(value = "数控切割开始")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 30)
@DateTimeFormat("yyyy/MM/dd")
private String skks3;
private String n2cxSj;
@ApiModelProperty(value = "坡口长度")
@ApiModelProperty(value = "2跨超长超宽曲板大组")
@ExcelProperty(index = 31)
private Double pkcd3;
private int n2cd;
@ApiModelProperty(value = "坡口切割结束")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 32)
@DateTimeFormat("yyyy/MM/dd")
private String pkjs4;
private String n2cdSj;
@ApiModelProperty(value = "面板挤边")
@ApiModelProperty(value = "2跨T型材腹板小组")
@ExcelProperty(index = 33)
@DateTimeFormat("yyyy/MM/dd")
private String mbjb;
private int n2tx;
@ApiModelProperty(value = "七垮型材米数")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 34)
private Double xcms;
private String n2txSj;
@ApiModelProperty(value = "型材面板")
@ApiModelProperty(value = "2跨T型材腹板大组")
@ExcelProperty(index = 35)
private String xcmb;
private int n2td;
@ApiModelProperty(value = "分段需求")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 36)
@DateTimeFormat("yyyy/MM/dd")
private String fdxqq;
private String n2tdSj;
@ApiModelProperty(value = "光电 结束")
@ApiModelProperty(value = "2跨激光切割板小组")
@ExcelProperty(index = 37)
@DateTimeFormat("yyyy/MM/dd")
private String gdjs;
private int n2jx;
@ApiModelProperty(value = "备注")
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 38)
private String bz;
private String n2jxSj;
@ApiModelProperty(value = "2跨激光切割板大组")
@ExcelProperty(index = 39)
private int n2jd;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 40)
private String n2jdSj;
@ApiModelProperty(value = "3跨曲板小组")
@ExcelProperty(index =41 )
private int n3cx;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 42)
private String n3cxSj;
@ApiModelProperty(value = "3跨曲板大组")
@ExcelProperty(index = 43)
private int n3cd;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 44)
private String n3cdSj;
@ApiModelProperty(value = "3跨厚板小组")
@ExcelProperty(index = 45)
private int n3hx;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 46)
private String n3hxSj;
@ApiModelProperty(value = "3跨厚板大组")
@ExcelProperty(index = 47)
private int n3hd;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 48)
private String n3hdSj;
@ApiModelProperty(value = "4跨普通板小组")
@ExcelProperty(index = 49)
private int n4px;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 50)
private String n4pxSj;
@ApiModelProperty(value = "4跨普通板大组")
@ExcelProperty(index = 51)
private int n4pd;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 52)
private String n4pdSj;
@ApiModelProperty(value = "4跨普通板机器人")
@ExcelProperty(index = 53)
private int n4xx;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 54)
private String n4xxSj;
@ApiModelProperty(value = "光电")
@ExcelProperty(index = 55)
private int n8gx;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 56)
private String n8gxSj;
@ApiModelProperty(value = "7跨型板小组")
@ExcelProperty(index = 57)
private int x7xx;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 58)
private String x7xxSj;
@ApiModelProperty(value = "7跨型板大组")
@ExcelProperty(index = 59)
private int x7xd;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 60)
private String x7xdSj;
@ApiModelProperty(value = "2跨T型材面板小组")
@ExcelProperty(index = 61)
private int s2tx;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 62)
private String s2txSj;
@ApiModelProperty(value = "2跨T型材面板大组")
@ExcelProperty(index = 63)
private int s2td;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 64)
private String s2tdSj;
@ApiModelProperty(value = "3跨平铁小组")
@ExcelProperty(index = 65)
private int s3px;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 66)
private String s3pxSj;
@ApiModelProperty(value = "3跨平铁大组")
@ExcelProperty(index =67 )
private int s3pd;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 68)
private String s3pdSj;
@ApiModelProperty(value = "3跨平铁机器人")
@ExcelProperty(index = 69)
private int s3xx;
@ApiModelProperty(value = "加工时间")
@ExcelProperty(index = 70)
private String s3xxSj;
@ApiModelProperty(value = "数据来源船")
@ExcelProperty(index = 71)
private String sjlyCh;
@TableId(value = "id", type = IdType.ASSIGN_UUID)
@ExcelProperty(index = 72)
private String id;

@ -2,6 +2,7 @@ package com.dsic.gj_erp.controller.jhgk;
import com.alibaba.fastjson.JSONObject;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jhgk.DmDhqdp;
import com.dsic.gj_erp.bean.jhgk.DmZrcjh;
@ -12,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
@ -39,8 +41,10 @@ public class DmDhqdpController {
@ApiOperation(value = "导入excel")
@PostMapping(value = "/upload")
public ResultBean upload(@RequestParam(value = "file") MultipartFile file) throws IOException {
List<DmDhqdp> dmZrcjhs= dmDhqdpService.upload(file);
@AuthFunction
@ResponseBody
public ResultBean upload(@RequestParam(value = "file") MultipartFile file, HttpServletRequest req) throws IOException {
List<DmDhqdp> dmZrcjhs= dmDhqdpService.upload(file,req);
return new ResultBean(dmZrcjhs);
}

@ -41,8 +41,10 @@ public class DmJtsyjhController {
@ApiOperation(value = "导入excel")
@PostMapping(value = "/upload")
public ResultBean upload(@RequestParam(value = "file") MultipartFile file) throws IOException {
List<DmJtsyjh> dmXbjhs= dmJtsyjhService.upload(file);
@AuthFunction
@ResponseBody
public ResultBean upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) throws IOException {
List<DmJtsyjh> dmXbjhs= dmJtsyjhService.upload(file,req);
return new ResultBean(dmXbjhs);
}

@ -51,7 +51,7 @@ public class DmSygdController {
.eq("gd_zt",sygd.getGdZt())
.ge(StrUtil.isNotEmpty(sygd.getBeginTime()),"sl_sj",sygd.getBeginTime())
.le(StrUtil.isNotEmpty(sygd.getEndTime()),"sl_sj",sygd.getEndTime())
.orderByAsc("dc_ch,dc_pl")
.orderByAsc("sl_sj,dc_ch,dc_pl")
);
return new ResultBean(list);
}

@ -1,6 +1,7 @@
package com.dsic.gj_erp.controller.jhgk;
import cn.hutool.core.date.DateUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -16,5 +17,24 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/dmSygdMxLj")
public class DmSygdMxLjController {
public static void main(String[] agrs) {
// String a = "2023/08/20";
// String b = "2023/08/21";
// System.out.println(a.compareTo(b));
System.out.println(DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01"));
System.out.println(DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd"));
// String[] a={"船只", "批量号", "总段号", "分段号", "大组极重", "总装部最新分段需求期", "钢料需求", "X大板", "X数控件", "X平铁", "X压弯", "X型材", "X二次装T型材"};
// String[] a1={"dcCh","dcPl", "zdh","dcFd","dzjz","zxfdxq", "glxq", "xdb", "xskj,",
// "xpt,", "xyw", "xxc", "xtxc", };
// String[] b={"日期", "垛位", "船", "批量", "跨位" };
// String[] b1={"","","","",""};
// for (int i = 0; i < b.length; i++) {
// System.out.println("{ field: '"+b1[i]+"', title: '"+b[i]+"', width: 120, \n" +
// " filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],\n" +
// " filterRender: { name: 'FilterCombination', },\n" +
// "},");
// }
}
}

@ -43,8 +43,10 @@ public class DmZrcjhController {
@ApiOperation(value = "导入excel")
@PostMapping(value = "/upload")
public ResultBean upload(@RequestParam(value = "file") MultipartFile file) throws IOException {
List<DmZrcjh> dmZrcjhs= dmZrcjhService.upload(file);
@AuthFunction
@ResponseBody
public ResultBean upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) throws IOException {
List<DmZrcjh> dmZrcjhs= dmZrcjhService.upload(file,req);
return new ResultBean(dmZrcjhs);
}

@ -31,7 +31,7 @@ public class ExcelSYListener extends AnalysisEventListener<SyExcel> {
//一条数据添加到暂时存储的存储结构中
boolean b = ObjConvertUtils.checkObjAllFieldsIsNull(excelDemo);
String dcCh = excelDemo.getDcCh1();
String dcCh = excelDemo.getDcCh();
String dcpl = excelDemo.getDcPl();
// String dcfd = excelDemo.getDcFd(); && StringUtils.isNotBlank(dcfd)
if(!b && StringUtils.isNotBlank(dcCh) && StringUtils.isNotBlank(dcpl)){

@ -61,7 +61,7 @@ public class EmSbcnpServiceImpl extends ServiceImpl<EmSbcnpMapper, EmSbcnp> impl
@Override
public void delete(List<EmSbcnp> emSbcnps) {
// emSbcnpRepository.deleteAll(emSbcnps);
List<String> idList=emSbcnps.stream().map(EmSbcnp::getSbbh).collect(Collectors.toList());
List<String> idList=emSbcnps.stream().map(EmSbcnp::getId).collect(Collectors.toList());
emSbcnpMapper.deleteBatchIds(idList);
}

@ -23,9 +23,9 @@ import java.util.List;
public interface DmDhqdpService extends IService<DmDhqdp> {
List<DmDhqdp> getList(JSONObject json);
void save(List<DmDhqdp> dmDhqdps);
List<DmDhqdp> save(List<DmDhqdp> dmDhqdps);
List<DmDhqdp> upload(MultipartFile file) throws IOException;
List<DmDhqdp> upload(MultipartFile file, HttpServletRequest req) throws IOException;
void sh(List<DmDhqdp> dmDhqdps);

@ -22,9 +22,9 @@ public interface DmJtsyjhService extends IService<DmJtsyjh> {
List<DmJtsyjh> getList(JSONObject json);
List<DmJtsyjh> upload(MultipartFile file) throws IOException;
List<DmJtsyjh> upload(MultipartFile file, HttpServletRequest req) throws IOException;
void save(HttpServletRequest request, List<DmJtsyjh> dmJtsyjhs);
List<DmJtsyjh> save(HttpServletRequest request, List<DmJtsyjh> dmJtsyjhs);
void tj(List<DmJtsyjh> dmJtsyjhs);
}

@ -21,9 +21,9 @@ import java.util.List;
public interface DmZrcjhService extends IService<DmZrcjh> {
List<DmZrcjh> getList(JSONObject json);
List<DmZrcjh> upload(MultipartFile file) throws IOException;
List<DmZrcjh> upload(MultipartFile file, HttpServletRequest req) throws IOException;
void save(HttpServletRequest req, List<DmZrcjh> dmZrcjhs);
List<DmZrcjh> save(HttpServletRequest req, List<DmZrcjh> dmZrcjhs);
void tj(List<DmZrcjh> dmZrcjhs);

@ -1,6 +1,7 @@
package com.dsic.gj_erp.service.jhgk.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.alibaba.fastjson.JSONObject;
@ -18,6 +19,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@ -49,12 +51,13 @@ public class DmDhqdpServiceImpl extends ServiceImpl<DmDhqdpMapper, DmDhqdp> impl
}
@Override
public void save(List<DmDhqdp> dmDhqdps) {
public List<DmDhqdp> save(List<DmDhqdp> dmDhqdps) {
saveBatch(dmDhqdps);
return dmDhqdps;
}
@Override
public List<DmDhqdp> upload(MultipartFile file) throws IOException {
public List<DmDhqdp> upload(MultipartFile file, HttpServletRequest req) throws IOException {
ExcelReader reader= ExcelUtil.getReader(file.getInputStream());
Map<String, String> alias = Maps.newLinkedHashMap();
alias.put("船号", "dcCh");
@ -114,7 +117,16 @@ public class DmDhqdpServiceImpl extends ServiceImpl<DmDhqdpMapper, DmDhqdp> impl
// alias.put("状态", "zt");
reader.setHeaderAlias(alias);
List<DmDhqdp> dmDhqdps= reader.readAll(DmDhqdp.class);
return dmDhqdps;
String day = DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
String user = (String) req.getAttribute("yhms");
dmDhqdps.forEach(l->{
this.remove(new QueryWrapper<DmDhqdp>().eq("Dc_ch",l.getDcCh())
.eq("qdh",l.getQdh())
.eq("qc",l.getQc()));
l.setDrr(user);
l.setDrrq(day);
});
return this.save(dmDhqdps);
}
@Override

@ -62,7 +62,7 @@ public class DmJtsyjhServiceImpl extends ServiceImpl<DmJtsyjhMapper, DmJtsyjh> i
}
@Override
public List<DmJtsyjh> upload(MultipartFile file) throws IOException {
public List<DmJtsyjh> upload(MultipartFile file, HttpServletRequest req) throws IOException {
List<Map<String,Object>> list= ExcelUtil.readJTSYJH(file);
List<DmJtsyjh> dmJtsyjhs=new ArrayList<>();
list.forEach(stringObjectMap -> {
@ -71,13 +71,17 @@ public class DmJtsyjhServiceImpl extends ServiceImpl<DmJtsyjhMapper, DmJtsyjh> i
DmJtsyjh dmZrcjh = modelMapper.map(stringObjectMap, DmJtsyjh.class);
dmZrcjh.setDcFd(fd);
dmJtsyjhs.add(dmZrcjh);
this.remove(new QueryWrapper<DmJtsyjh>().eq("Dc_ch",dmZrcjh.getDcCh())
.eq("Dc_pl",dmZrcjh.getDcPl()).eq("Dc_fd",dmZrcjh.getDcFd()));
}
});
return dmJtsyjhs;
return this.save(req,dmJtsyjhs);
}
@Override
public void save(HttpServletRequest request, List<DmJtsyjh> dmJtsyjhs) {
public List<DmJtsyjh> save(HttpServletRequest request, List<DmJtsyjh> dmJtsyjhs) {
String yhdm = (String) request.getAttribute("yhdm");
Date date=new Date();
@ -92,6 +96,7 @@ public class DmJtsyjhServiceImpl extends ServiceImpl<DmJtsyjhMapper, DmJtsyjh> i
for (List<DmJtsyjh> list:lists) {
dmJtsyjhMapper.updateCzplpNEW(list);
}
return dmJtsyjhs;
}
@Override

@ -38,14 +38,14 @@ public class DmQfxqServiceImpl extends ServiceImpl<DmQfxqMapper, DmQfxq> impleme
@Transactional(rollbackFor = Exception.class)
public ResultBean uploadQf(List<QfExcel> list, String project, HttpServletRequest req) {
List<DmQfxq> listForSave = new ArrayList<>();
Map<String, Set<String>> chs = list.stream().filter(f -> StringUtils.isNotBlank(f.getDcPl()))
.collect(Collectors.groupingBy(QfExcel::getDcCh, Collectors.mapping(QfExcel::getDcPl, Collectors.toSet())));
for (String ch : chs.keySet()) {
int i = this.count(new QueryWrapper<DmQfxq>().eq("DC_CH", ch).in("DC_PL", chs.get(ch)));
if (i > 0) {
return new ResultBean(false, 10000, "请勿重复导入,船号:" + ch + ",批量:" + chs.get(ch));
}
}
// Map<String, Set<String>> chs = list.stream().filter(f -> StringUtils.isNotBlank(f.getDcPl()))
// .collect(Collectors.groupingBy(QfExcel::getDcCh, Collectors.mapping(QfExcel::getDcPl, Collectors.toSet())));
// for (String ch : chs.keySet()) {
// int i = this.count(new QueryWrapper<DmQfxq>().eq("DC_CH", ch).in("DC_PL", chs.get(ch)));
// if (i > 0) {
// return new ResultBean(false, 10000, "请勿重复导入,船号:" + ch + ",批量:" + chs.get(ch));
// }
// }
for (QfExcel q : list) {
DmQfxq a = new DmQfxq();
BeanUtil.copyProperties(q, a);
@ -54,6 +54,7 @@ public class DmQfxqServiceImpl extends ServiceImpl<DmQfxqMapper, DmQfxq> impleme
a.setBzry((String) req.getAttribute("yhms"));
a.setBzrq(DateUtil.format(DateUtil.date(), "yyyy/MM/dd"));
listForSave.add(a);
this.remove(new QueryWrapper<DmQfxq>().eq("Dc_ch",a.getDcCh()).eq("Dc_pl",a.getDcPl()).eq("Dc_fd",a.getDcFd()));
}
this.saveBatch(listForSave);
//生成月度计划信息

@ -27,6 +27,8 @@ import com.dsic.gj_erp.service.jhgk.DmXbjhService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@ -64,16 +66,21 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
* @return
*/
@Override
@Transactional
@Transactional(isolation = Isolation.READ_UNCOMMITTED)
public Map sygdPC() {
//todo 重复导入(三月滚动计划)的数据处理
//零件 删除
String begin=DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd");
ljService.remove(new QueryWrapper<DmSygdMxLj>().between("xzglxq",begin,end));
this.remove(new QueryWrapper<DmSygdMx>().between("jssj",begin,end));
sygdService.remove(new QueryWrapper<DmSygd>().between("sl_sj",begin,end));
List<DmSygdMxLj> ljList = baseMapper.getLjxx();
//零件排产 按时间 船号 批量 图号 排序
//默认定额 坡口 打磨 曲
//todo 保存前判断是否有,已排完的数据
ljService.saveBatch(ljList);
if (ljList.size()<1){
throw new RuntimeException("请先导入前方三月需求!");
}
List<DmSygdMx> mxList = baseMapper.getMx();
mxList.forEach(l -> {
if (StrUtil.isNotEmpty(l.getWpgg())) {
@ -88,10 +95,9 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
l.setBcshzl(Double.valueOf(String.format("%.2f", c)));
}
});
this.saveBatch(mxList);
baseMapper.setParent();
//todo 排产
ypc(mxList);
baseMapper.setParent();
Map map2 = new HashMap();
map2.put("mxList", mxList);
@ -107,11 +113,10 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
//1.根据组立结束时间排序,决定生产顺序
list = list.stream().sorted(Comparator.comparing(DmSygdMx::getJssj, Comparator.nullsLast(Comparator.naturalOrder()))).collect(Collectors.toList());
//2.未来工厂日历信息
String begin=DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd");
List<EmGcrl> gcrlList = gcrlMapper.selectList(new QueryWrapper<EmGcrl>()
.eq("xxr", "1")
// .between("gl","2023/08/01","2023/08/31")
.gt("gl", "2023/08/01")
// DateUtil.date().toString("yyyy/MM/dd"))
.between("gl",begin,end)
.orderByAsc("gl"));
//3.预排产
//TODO 假设产能测算266.9;又套料图需当天完成
@ -123,6 +128,7 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
list.get(index).setSlrq(gcrlList.get(i).getGl());
list.get(index).setHxrq(gcrlList.get(i).getGl());
list.get(index).setQgrq(gcrlList.get(i).getGl());
list.get(index).setXxr(gcrlList.get(i).getXxr());
} else {
j = 266;
i = gcrlList.size();
@ -239,14 +245,20 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
&& m.getJssj().substring(0,7) .equals(l.getYf())
).collect(Collectors.toList()));
// l.setMxList(
// this.list(new QueryWrapper<DmSygdMx>().eq("dc_ch", l.getCh())
// .eq("dc_pl", l.getPl())
// .eq(StrUtil.isNotEmpty(l.getKw()),"kw", l.getKw())
// .eq("substring(dm_sygd_mx.jssj, 0, 8)", l.getYf())
// .orderByAsc("jssj")));
});
return kwdtoList;
Map<String,List<Kwdto>> map= kwdtoList.stream().collect(Collectors.groupingBy(Kwdto::getYf));
List<Kwdto> kws=new ArrayList<>();
for (String yf : map.keySet()) {
int count= list.stream().filter(
m -> m.getJssj().substring(0,7) .equals(yf)
).collect(Collectors.toList()).size();
Kwdto k=new Kwdto();
k.setYf(yf.substring(5,7)+"月份合计");
k.setBs(new BigDecimal(count));
kws.add(k);
kws.addAll(map.get(yf));
}
return kws;
}
public List<Kwdto> getKwList_n(List<DmSygdMx> list) {
@ -356,10 +368,14 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
//1.查询未来3个月明细信息
//测试
// List<DmSygdMx> list=null;
String begin=DateUtil.format(DateUtil.nextMonth(),"yyyy/MM/01");
String end =DateUtil.format(DateUtil.endOfMonth(DateUtil.offsetMonth(DateUtil.date(),3)),"yyyy/MM/dd");
List<DmSygdMx> list = this.list(new QueryWrapper<DmSygdMx>()
.between("gjks",
"2023/08/01",
"2023/08/31")
.between("jssj",
begin,
end)
.orderByAsc("jssj")
);
if (ObjectUtil.isEmpty(list) || list.size() < 1) {
return new ResultBean(null);
@ -374,8 +390,12 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
sygd.setDcPl(mxList.get(0).getDcPl());
sygd.setDcFd(mxList.get(0).getDcFd());
sygd.setTltSl(mxList.size());
sygd.setSlSj(mxList.get(0).getSlrq());
sygd.setSlSl(mxList.size());
sygd.setPwSj(mxList.get(0).getSlrq());
sygd.setPwSl(mxList.size());
sygd.setGjjsDz(mxList.get(0).getJssj());
sygd.setGjjsXz(mxList.get(0).getGjjsDz());
//跨位信息
Map<String, List<DmSygdMx>> kwMap = map.get(key).stream().collect(Collectors.groupingBy(x -> Optional.ofNullable(x.getKw()).orElse("0")));
for (String kw : kwMap.keySet()) {
@ -384,8 +404,9 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
for (String zl : zlMap.keySet()) {
//跨位、组立下,多张套料图的最开始加工时间,最后加工时间;(上料日期)
List<DmSygdMx> kssj = zlMap.get(zl).stream().sorted(Comparator.comparing(DmSygdMx::getSlrq, Comparator.nullsLast(Comparator.naturalOrder()))).collect(Collectors.toList());
List<DmSygdMx> jssj = zlMap.get(zl).stream().sorted(Comparator.comparing(DmSygdMx::getSlrq, Comparator.nullsLast(Comparator.naturalOrder())).reversed()).collect(Collectors.toList());
String sj = kssj.get(0).getSlrq() + " - " + jssj.get(0).getSlrq();
// List<DmSygdMx> jssj = zlMap.get(zl).stream().sorted(Comparator.comparing(DmSygdMx::getSlrq, Comparator.nullsLast(Comparator.naturalOrder())).reversed()).collect(Collectors.toList());
String sj = kssj.get(0).getSlrq();
if (kw.equals("7")) {//1跨平直大板
if (zl.equals("1110")) {//大组
@ -507,11 +528,11 @@ public class DmSygdMxServiceImpl extends ServiceImpl<DmSygdMxMapper, DmSygdMx> i
if (kw.equals("16")) {//7跨型板
if (zl.equals("1110")) {//大组
//todo 型材米数
// sygd.setX7xd(kssj.size());
sygd.setX7xd(kssj.size());
sygd.setX7xdSj(sj);
}
if (zl.equals("1010")) {//小组
// sygd.setX7xx(kssj.size());
sygd.setX7xx(kssj.size());
sygd.setX7xxSj(sj);
}
}

@ -75,7 +75,7 @@ public class DmSygdServiceImpl extends ServiceImpl<DmSygdMapper, DmSygd> impleme
// a.setBzrq(DateUtil.format(DateUtil.date(), "yyyy/MM/dd"));
listForSave.add(a);
}
this.saveBatch(listForSave);
this.updateBatchById(listForSave);
return null;
}

@ -12,6 +12,7 @@ import com.dsic.gj_erp.util.ExcelUtil;
import org.apache.commons.lang3.StringUtils;
import org.modelmapper.ModelMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
@ -61,16 +62,19 @@ public class DmXbjhServiceImpl extends ServiceImpl<DmXbjhMapper, DmXbjh> impleme
// ExcelReader reader = ExcelUtil.getReader(file.getInputStream());
//List<DmXbjh> dmXbjhs= ExcelUtil.readDmXbjh(file);
JSONObject dmXbjhs= ExcelUtil.readDmXbjh(file);
// List<DmXbjh> list=new ArrayList<>();
// mapList.forEach(stringObjectMap -> {
// DmXbjh dmXbjh = modelMapper.map(stringObjectMap, DmXbjh.class);
// dmXbjh.setZt("0");
// list.add(dmXbjh);
// });
this.save(dmXbjhs);
return dmXbjhs;
}
@Override
@Transactional
public void save(JSONObject json) {
List<DmXbjh> dmXbjhs=new ArrayList<>();
for (String key:json.keySet()) {
@ -80,8 +84,13 @@ public class DmXbjhServiceImpl extends ServiceImpl<DmXbjhMapper, DmXbjh> impleme
DmXbjh dmXbjh= modelMapper.map(object,DmXbjh.class);
dmXbjh.setDcCh(key);
dmXbjhs.add(dmXbjh);
this.remove(new QueryWrapper<DmXbjh>().eq("dc_ch",dmXbjh.getDcCh())
.eq("nf",dmXbjh.getNf())
.eq("yf",dmXbjh.getYf())
);
}
}
saveBatch(dmXbjhs);
}

@ -64,7 +64,7 @@ public class DmZrcjhServiceImpl extends ServiceImpl<DmZrcjhMapper, DmZrcjh> impl
}
@Override
public List<DmZrcjh> upload(MultipartFile file) throws IOException {
public List<DmZrcjh> upload(MultipartFile file, HttpServletRequest req) throws IOException {
List<Map<String, Object>> list = ExcelUtil.readZRCJH(file);
List<DmZrcjh> dmZrcjhs = new ArrayList<>();
list.forEach(stringObjectMap -> {
@ -73,12 +73,13 @@ public class DmZrcjhServiceImpl extends ServiceImpl<DmZrcjhMapper, DmZrcjh> impl
String pl = dmZrcjh.getDcPl().length() == 1 ? "00" + dmZrcjh.getDcPl() : dmZrcjh.getDcPl().length() == 2 ? "0" + dmZrcjh.getDcPl() : dmZrcjh.getDcPl();
dmZrcjh.setDcPl(pl);
dmZrcjhs.add(dmZrcjh);
});
return dmZrcjhs;
return this.save(req,dmZrcjhs);
}
@Override
public void save(HttpServletRequest req, List<DmZrcjh> dmZrcjhs) {
public List<DmZrcjh> save(HttpServletRequest req, List<DmZrcjh> dmZrcjhs) {
String bzr = (String) req.getAttribute("yhms");
Date date = new Date();
@ -109,11 +110,14 @@ public class DmZrcjhServiceImpl extends ServiceImpl<DmZrcjhMapper, DmZrcjh> impl
String appendBzrq = (dmZrcjhOneBzrq + "@" + day);
dmZrcjh.setBzr(appendBzr);
dmZrcjh.setBzrq(appendBzrq);
dmZrcjh.setXh(dmZrcjhOne.getXh());
updateById(dmZrcjh);
}
} else {
dmZrcjh.setBzr(dmZrcjhOneBzr + "@" + bzr);
dmZrcjh.setBzrq(dmZrcjhOneBzrq + "@" + day);
dmZrcjh.setXh(dmZrcjhOne.getXh());
updateById(dmZrcjh);
}
} else {
@ -129,7 +133,7 @@ public class DmZrcjhServiceImpl extends ServiceImpl<DmZrcjhMapper, DmZrcjh> impl
for (List<DmZrcjh> list : lists) {
dmZrcjhMapper.updateCzplpNEW(list);
}
return saveDmzrcjhList;
}
@Override

@ -27,6 +27,153 @@
</select>
<select id="getLjxx" resultType="com.dsic.gj_erp.bean.jhgk.DmSygdMxLj">
insert into dm_sygd_mx_lj(
xzglxq ,
dzglxq ,
dcch,
pl,
fd,
mbch,
xqdd,
pw,
lqlb,
kw,
sbbh,
sclx,
zl,
wpcz,
wpgg,
bh,
bc,
yqyl,
qgcd,
tzbh,
tlsl,
pklx,
qbs,
pkbs,
pkcd,
dmbs,
dmcd,
zpsx,
ljbh,
ljsl,
ljsx,
djmj,
ljdz,
blgs,
pwgs,
llgs,
hxgs,
qggs,
pkgs,
qgs,
dmgs,
zpgs,
fkblgs,
fkpwgs,
fkllgs,
fkhxgs,
fkqggs,
fkpkgs,
fkqgs,
fkdmgs,
fkzpgs,
type,
fds,
hxcd,
lqbs,
xcgs,
xcshms,
bclqzl,
bcshzl,
bcylzl,
bcljtlzl,
ylbhgg,
bcqpyld,
id
)
SELECT
dm_sygdxq.xzglxq ,
dm_sygdxq.dzglxq ,
dm_sygdxq.DC_CH as dcch,
dm_sygdxq.DC_PL as pl,
dm_sygdxq.DC_FD as fd,
dm_bom.mbch,
dm_bom.xqdd,
dm_bom.pw,
dm_bom.lqlb,
dm_bom.kw,
dm_bom.sbbh,
dm_bom.sclx,
dm_bom.zl,
dm_bom.wpcz,
dm_bom.wpgg,
dm_bom.bh,
dm_bom.bc,
dm_bom.yqyl,
dm_bom.qgcd,
(SELECT (CASE WHEN dm_bom.tzbh is null THEN '' ELSE dm_bom.tzbh END)) as tzbh,
dm_bom.tlsl,
dm_bom.pklx,
dm_bom.qbs,
dm_bom.pkbs,
dm_bom.pkcd,
dm_bom.dmbs,
dm_bom.dmcd,
dm_bom.zpsx,
dm_bom.ljbh,
dm_bom.ljsl,
dm_bom.ljsx,
dm_bom.djmj,
dm_bom.ljdz,
dm_bom.blgs,
dm_bom.pwgs,
dm_bom.llgs,
dm_bom.hxgs,
dm_bom.qggs,
dm_bom.pkgs,
dm_bom.qgs,
dm_bom.dmgs,
dm_bom.zpgs,
dm_bom.fkblgs,
dm_bom.fkpwgs,
dm_bom.fkllgs,
dm_bom.fkhxgs,
dm_bom.fkqggs,
dm_bom.fkpkgs,
dm_bom.fkqgs,
dm_bom.fkdmgs,
dm_bom.fkzpgs,
dm_bom.type,
dm_bom.fds,
dm_bom.hxcd,
dm_bom.lqbs,
dm_bom.xcgs,
dm_bom.xcshms,
dm_bom.bclqzl,
dm_bom.bcshzl,
dm_bom.bcylzl,
dm_bom.bcljtlzl,
dm_bom.ylbhgg,
dm_bom.bcqpyld,
REPLACE(CAST(CAST(NEWID()AS BINARY(10)) + CAST(GETDATE() AS BINARY(6)) AS UNIQUEIDENTIFIER),'-','') as id
from dm_sygdxq LEFT JOIN dm_bom
on dm_bom.dcch = dm_sygdxq.DC_CH
and dm_bom.pl = dm_sygdxq.DC_PL
and dm_bom.fd = dm_sygdxq.DC_FD
where
-- dm_sygdxq.xzglxq between '2023/08/01' and '2023/10/31'
dm_sygdxq.xzglxq between
(SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and
(Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
ORDER BY dm_sygdxq.xzglxq,dm_sygdxq.DC_CH,dm_sygdxq.DC_PL,dm_bom.TZBH,dm_sygdxq.DC_FD
</select>
<select id="g" resultType="com.dsic.gj_erp.bean.jhgk.DmSygdMxLj">
SELECT Em_gcrl.gzr,dm_sygdxq.xzglxq ,dm_sygdxq.dzglxq ,dm_sygdxq.DC_CH as dcch,dm_sygdxq.DC_CH as sjch,dm_sygdxq.DC_PL as pl,dm_sygdxq.DC_FD as fd,dm_bom.*
from Em_gcrl,dm_sygdxq LEFT JOIN dm_bom
on dm_bom.dcch = dm_sygdxq.DC_CH
@ -34,19 +181,18 @@
and dm_bom.fd = dm_sygdxq.DC_FD
where
dm_sygdxq.xzglxq = Em_gcrl.gl and
dm_sygdxq.xzglxq between '2023/08/01' and '2023/10/31'
-- dm_sygdxq.xzglxq between
-- (SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
-- and
-- (Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
-- dm_sygdxq.xzglxq between '2023/08/01' and '2023/10/31'
dm_sygdxq.xzglxq between
(SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and
(Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
ORDER BY dm_sygdxq.xzglxq,dm_sygdxq.DC_CH,dm_sygdxq.DC_PL,dm_bom.TZBH,dm_sygdxq.DC_FD
</select>
<select id="getMx" resultType="com.dsic.gj_erp.bean.jhgk.DmSygdMx">
SELECT
dcch as dcCh2,
mbch as dc_ch1,
sjch as dc_ch,
dcch as dc_ch,
mbch as dcCh2,
sjch as dc_ch1,
pl as dc_pl,
tzbh,
stuff((SELECT ' ' + c.FD
@ -55,7 +201,7 @@
group by c.FD FOR xml path ( '') ), 1, 1, ''
) AS dc_fd,
MIN(xzglxq) as jssj,
MIN(dzglxq) as dzglxq,
MIN(dzglxq) as gjjs_dz,
(CONVERT(varchar (20), GETDATE(), 20)) as gxsj,
(SELECT (CASE WHEN substring(tzbh, 5, 1) = 'X' THEN 'X' ELSE 'B' END)) as lx,
lqlb,
@ -90,24 +236,22 @@
from dm_sygd_mx_lj
where
dm_sygd_mx_lj.xzglxq between '2023/08/01' and '2023/10/31'
-- dm_sygd_mx_lj.xzglxq between
-- (SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
-- and
-- (Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
-- dm_sygd_mx_lj.xzglxq between '2023/08/01' and '2023/10/31'
dm_sygd_mx_lj.xzglxq between
(SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and
(Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
GROUP BY dcch, mbch, sjch, PL, tzbh
, lqlb, kw, zl, wpcz, wpgg, ljsl, pklx, qbs, pkbs
, pkcd, dmbs, dmcd, hxcd, xcgs, xcshms, bclqzl
, bcylzl, bcljtlzl, ylbhgg, bcqpyld , blgs , pwgs, llgs, hxgs, qggs
order BY jssj, dcch, pl, tzbh
</select>
<select id="getPl" resultType="com.dsic.gj_erp.bean.jhgk.dto.Pldto">
SELECT
iif(a.dc_ch is null,b.dc_ch ,a.dc_ch )as dc_ch,
iif(a.DC_FD is null,b.DC_FD ,a.DC_FD ) as DC_FD,
iif(a.dc_pl is null,b.dc_pl ,a.dc_pl ) as dc_pl,
(select(case when a.dc_ch is null then b.dc_ch else a.dc_ch end)) as dc_ch,
(select(case when a.DC_FD is null then b.DC_FD else a.DC_FD end)) as DC_FD,
(select(case when a.dc_pl is null then b.dc_pl else a.dc_pl end)) as dc_pl,
DATEDIFF(day, b.dzjsq , a.dzglxq) as dzcz,
DATEDIFF(day, b.xzjsq , a.xzglxq) as xzcz,
a.dzglxq,a.xzglxq,b.xzjsq,b.dzjsq
@ -122,18 +266,19 @@
a.DC_CH=b.DC_CH and a.dc_pl=b.DC_PL and a.DC_fd=b.DC_fd
ORDER BY case when a.xzglxq is null then 1 else 0 end,a.xzglxq,dc_ch,dc_pl,b.xzjsq asc
</select>
<update id="setParent" >
UPDATE dm_sygd_mx_lj set dm_sygd_mx_lj.parent_id=dm_sygd_mx.id
from dm_sygd_mx
WHERE
dm_sygd_mx_lj.dcch=dm_sygd_mx.dc_ch and dm_sygd_mx_lj.pl=dm_sygd_mx.dc_pl and dm_sygd_mx_lj.tzbh= iif(dm_sygd_mx_lj.tzbh is null,'',dm_sygd_mx.tzbh )
and dm_sygd_mx_lj.xzglxq between '2023/08/01' and '2023/10/31'
-- dm_sygd_mx_lj.xzglxq between
-- (SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
-- and
-- (Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
dm_sygd_mx_lj.dcch=dm_sygd_mx.dc_ch
and dm_sygd_mx_lj.pl=dm_sygd_mx.dc_pl
and (dm_sygd_mx_lj.tzbh = '' or dm_sygd_mx_lj.tzbh=dm_sygd_mx.tzbh )
-- and dm_sygd_mx_lj.xzglxq between '2023/08/01' and '2023/10/31'
dm_sygd_mx_lj.xzglxq between
(SELECT CONVERT(varchar(10),DATEADD(m,1,DATEADD(dd,-DAY(GETDATE())+1,GETDATE())),111)
and
(Select CONVERT(varchar(10), eomonth(GETDATE(),3), 111))
</update>
<select id="getkw" resultType="com.dsic.gj_erp.bean.jhgk.dto.Kwdto">
SELECT
@ -198,7 +343,7 @@
order by dm_sygd_mx.yf
, case when dm_sygd_mx.kw is null then 1 else 0 end
,dm_sygd_mx.kw
,dm_sygd_mx.CH
,dm_sygd_mx.ch
,dm_sygd_mx.PL
</select>

Loading…
Cancel
Save