master
xhj 2 years ago
parent fa52944ec4
commit f5d9015c11

@ -6,6 +6,7 @@ import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import java.io.Serializable;
/**
@ -19,6 +20,7 @@ import java.io.Serializable;
@Data
@TableName("DM_BHDYP")
@Entity
@IdClass(DmBhdyp.PrimaryKey.class)
public class DmBhdyp implements Serializable {
/**
@ -41,8 +43,7 @@ public class DmBhdyp implements Serializable {
@TableField("YLZD6")
private Double ylzd6;
@TableField("BMMC")
@Id
private String bmmc;
@TableField("YLZD3")
@ -50,8 +51,7 @@ public class DmBhdyp implements Serializable {
@TableField("YLZD4")
private Double ylzd4;
@TableField("ZXTBM")
@Id
private String zxtbm;
@TableField("YLZD1")
@ -59,5 +59,10 @@ public class DmBhdyp implements Serializable {
@TableField("BMQZ")
private String bmqz;
@Data
public static class PrimaryKey implements Serializable {
private String jgm;
private String bmmc;
private String zxtbm;
}
}

@ -6,6 +6,7 @@ import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import java.io.Serializable;
/**
@ -19,12 +20,12 @@ import java.io.Serializable;
@Data
@TableName("DM_BHSJP")
@Entity
@IdClass(DmBhsjp.PrimaryKey.class)
public class DmBhsjp implements Serializable {
@Id
private String bmqz;
@TableField("ZXTBM")
@Id
private String zxtbm;
@TableField("YLZD2")
@ -32,8 +33,7 @@ public class DmBhsjp implements Serializable {
@TableField("YLZD5")
private Double ylzd5;
@TableField("JGM")
@Id
private String jgm;
@TableField("YLZD6")
@ -50,9 +50,15 @@ public class DmBhsjp implements Serializable {
@TableField("YLZD4")
private Double ylzd4;
@TableField("BMMC")
@Id
private String bmmc;
@Data
public static class PrimaryKey implements Serializable {
private String bmqz;
private String zxtbm;
private String jgm;
private String bmmc;
}
}

@ -7,6 +7,7 @@ import com.dsic.gj_erp.bean.jcsj.vo.BomVO;
import com.dsic.gj_erp.exception.CustomException;
import com.dsic.gj_erp.service.jcsj.DmBomService;
import com.dsic.gj_erp.service.jcsj.impl.BomUploadServiceImpl;
import com.dsic.gj_erp.service.sy.SYService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -34,11 +35,19 @@ public class DmBomController {
@Autowired
BomUploadServiceImpl bomUploadService;
@Autowired
SYService syService;
@PostMapping("/getListBom")
public ResultBean getListBom(HttpServletRequest req, @RequestBody Map map) throws CustomException {
List<BomVO> listBom = dmBomService.getListBom(req,map);
return new ResultBean(listBom);
// List<BomVO> listBom = dmBomService.getListBom(req,map);
String id = syService.f_getpjh("DM", "SYSTEM", "BCHX");
String id1= syService.f_getpjh("DM", "SYSTEM", "CLDE");
System.out.println("id = " + id);
System.out.println("id = " + id1);
// return new ResultBean(listBom);
return new ResultBean(null);
}
@PostMapping("/getListBomRealy")
public ResultBean getListBomRealy(HttpServletRequest req, @RequestBody Map map) throws CustomException {

@ -19,6 +19,7 @@ import com.dsic.gj_erp.service.sy.SYService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.script.ScriptException;
@ -70,6 +71,7 @@ public class BomUploadServiceImpl {
@Autowired
DmBomService dmBomService;
@Transactional(rollbackFor = Exception.class)
public synchronized ResultBean uploadZ(MultipartFile[] file, String czbh, String pl, String isupload, HttpServletRequest req) throws IOException, CustomException, ScriptException {
String savePath = UUID.randomUUID().toString().replace("-", "");
//dezt="00";

@ -105,8 +105,8 @@ public class DmBomServiceImpl extends ServiceImpl<DmBomMapper, DmBom> implements
e.setMbch(e.getDcch());
e.setDcch(czbh);
e.setSjch("");
});
this.saveBatch(list,1000);
//this.saveBatch()
}
}

@ -147,6 +147,7 @@ public class SYService {
* @return
*/
@Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
// @Transactional
public String f_getpjh(String zxt,String jg,String bmm){
entityManager.clear(); // 清除缓存
QDmBhdyp bhdy=QDmBhdyp.dmBhdyp;
@ -234,6 +235,7 @@ public class SYService {
DmBhzyb bhzyb=new DmBhzyb();
bhzyb.setBhzyb(zxt +jg+bmm+f_qz+f_oxh);
dmBhzybRepository.save(bhzyb);
return f_qz+f_oxh;
}
}

Loading…
Cancel
Save