master
xhj 6 months ago
parent a244b131f0
commit 75966b6dbf

@ -361,6 +361,22 @@ public class DmYdjh implements Serializable {
private String kcbs; // 库存标识
@TableField(exist = false)
private Long bs;
@TableField(exist = false)
private Long slxhthCount;
@TableField(exist = false)
private Long slCount;
@TableField(exist = false)
private Long pwCount;
@TableField(exist = false)
private Long llCount;
@TableField(exist = false)
private Long hxCount;
@TableField(exist = false)
private Long qgCount;
public String getUniqueData(){
return StrUtil.format("{}_{}_{}_{}",this.dcCh,this.dcPl,this.dcFd,this.tzbh);
}

@ -60,6 +60,91 @@ public class DmYdjhController {
return new ResultBean<>();
}
@RequestMapping("/getListhz")
@AuthFunction
public ResultBean getListhz(@RequestBody Map<String, String> map ) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
// List<DmYdjh> list= service.list(new QueryWrapper<DmYdjh>()
// .eq(StrUtil.isNotEmpty(map.get("dcCh")),"dc_ch",map.get("dcCh"))
// .eq(StrUtil.isNotEmpty(map.get("zt")),"zt",map.get("zt"))
// .ge(StrUtil.isNotEmpty(map.get("yf")), "jssj", DateUtil.beginOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd"))
// .le(StrUtil.isNotEmpty(map.get("yf")), "jssj", DateUtil.endOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd"))
// .orderByAsc("jssj,dc_ch,dc_pl,zl,lqlb")
map.put("yf",DateUtil.beginOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd"));
// Map<String, List<DmYdjh>> collect = list.stream().collect(Collectors.groupingBy(DmYdjh::getDcCh));
// List<Map<String, Object>> resultMap=new ArrayList<>();
//验证数据获取方法,后续可以都在这里进行获取
// collect.forEach((key,val)->{
// List<ImCkwpkwp> bcKcxx = kcService.getBcKcxx(key);
// List<DmCzplpNew> czplpNewList = czplpNewService.list(Wrappers.<DmCzplpNew>lambdaQuery()
// .eq(DmCzplpNew::getDcCh, key)
// );
//
// val.forEach(item->{
// Map<String, Object> itemMap = BeanUtil.beanToMap(item);
// resultMap.add(itemMap);
// bcKcxx.forEach(kc->{
// if (item.getDcCh().equals(kc.getDcCh())
// &&item.getDcFd().equals(kc.getDcPl())
// &&item.getTzbh().equals(kc.getDcTh())){
// itemMap.put("kc",kc);
// }
// });
// czplpNewList.forEach(czplpNew->{
// if (item.getDcCh().equals(czplpNew.getDcCh())&&item.getDcPl().equals(czplpNew.getDcPl())) {
// /// 判断颜色
// itemMap.put("czplpNew", czplpNew);
//// if (StringUtils.isBlank(czplpNew.getXfqLqb())|| StringUtils.isBlank(item.getSlrq())) {
//// // corlor red
//// itemMap.put("color", "red");
//// } else {
//// DateTime dateStr1 = DateUtil.parse(czplpNew.getXfqLqb(), "yyyy/MM/dd");
//// DateTime dateStr2 = DateUtil.parse(item.getSlrq(), "yyyy/MM/dd");
//// int result = DateUtil.compare(dateStr1, dateStr2);
//// if (result > 0) {
//// System.out.println(dateStr1 + " is after " + dateStr2);
//// itemMap.put("color", "red");
//// } else if (result < 0) {
//// System.out.println(dateStr1 + " is before " + dateStr2);
////
//// } else {
//// System.out.println(dateStr1 + " is equal to " + dateStr2);
//// itemMap.put("color", "yellow");
//// }
//// }
//// if (StringUtils.isBlank(czplpNew.getXfqTlt())||StringUtils.isBlank(item.getHxrq())) {
//// // corlor yellow
//// itemMap.put("color", "red");
//// } else {
//// DateTime dateStr1 = DateUtil.parse(czplpNew.getXfqTlt(), "yyyy/MM/dd");
//// DateTime dateStr2 = DateUtil.parse(item.getHxrq(), "yyyy/MM/dd");
//// int result = DateUtil.compare(dateStr1, dateStr2);
//// if (result > 0) {
//// System.out.println(dateStr1 + " is after " + dateStr2);
//// itemMap.put("color", "red");
//// } else if (result < 0) {
//// System.out.println(dateStr1 + " is before " + dateStr2);
////
//// } else {
//// System.out.println(dateStr1 + " is equal to " + dateStr2);
//// itemMap.put("color", "yellow");
//// }
//// }
// }else {
// // itemMap.put("color", "red");
// }
// });
// });
// });
return new ResultBean();
}
@RequestMapping("/getList")
@AuthFunction
public ResultBean getList(@RequestBody Map<String, String> map ) {

@ -27,6 +27,7 @@ import com.dsic.gj_erp.service.pgd.PgdSljhService;
import com.dsic.gj_erp.service.sy.SYService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@ -947,5 +948,53 @@ public class PgdSljhController {
// retrunMap.put("ydjhs",ydupList);
return new ResultBean(retrunMap);
}
@PostMapping("kcAdnSlBdQX")
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public ResultBean kcAdnSlBdQX(HttpServletRequest req, @RequestBody Map map) throws Exception, CustomException {
String str= JSON.toJSONString(map.get("data1"));
List<SlKc> slKcs= JSONObject.parseArray(str, SlKc.class);
//
for(SlKc kc :slKcs){
DmYdjh ydjh =new DmYdjh();
// 库存主键 没存
ydjh.setId(kc.getYdid());
ydjh.setZt("2");
ydjh.setSlkcdw("");
ydjh.setSlcs("");
ydjh.setSlxhth("");
ydjh.setSlhth("");
ydjh.setSlwlh("");
ydjh.setKcch("");
dmYdjhService.updateById(ydjh);
ImCkwpkwp imCkwpkwp =new ImCkwpkwp();
imCkwpkwp.setCkh(kc.getCKH());
imCkwpkwp.setWph(kc.getWPH());
imCkwpkwp.setKwh(kc.getKWH());
imCkwpkwp.setNbsbm(kc.getNBSBM());
imCkwpkwp.setZylx("");
imCkwpkwp.setZych("");
imCkwpkwp.setZypl("");
imCkwpkwp.setDcTh("");
imCkwpkwp.setSldw("");
imCkwpkwp.setDhh("");
//slKc.setPwwz(dmYdjh.getKw());
imCkwpkwp.setYdid("");
imCkwpkwpService.updateByMultiId(imCkwpkwp);
}
return new ResultBean();
}
}

@ -51,4 +51,7 @@ public interface DmYdjhMapper extends BaseMapper<DmYdjh> {
List<Map<String,Object>> gcjd(List<String> czbh);
DmYdjh getYdjhMin(@Param("dcch") String dcch, @Param("dcpl") String dcpl);
List<DmYdjh> getydjhhz(Map map );
}

@ -840,4 +840,55 @@
where dc_ch=#{dcch} and dc_pl =#{dcpl}
</select>
<select id="getydjhhz" parameterType="string" resultType="com.dsic.gj_erp.bean.jhgk.DmYdjh">
SELECT
dm_ydjh.dc_ch,
dm_ydjh.dc_pl,
dm_ydjh.jssj,
dm_ydjh.sljhrq,
dm_ydjh.pwjhrq,
dm_ydjh.lljhrq,
dm_ydjh.hxjhrq,
dm_ydjh.qgjhrq,
COUNT(dm_ydjh.id) AS bs,
SUM(CASE WHEN ISNULL(dm_ydjh.slxhth, '') != '' THEN 1 ELSE 0 END) AS slxhth_count,
SUM(CASE WHEN ISNULL(dm_ydjh.slfkry, '') != '' THEN 1 ELSE 0 END) AS sl_count,
SUM(CASE WHEN ISNULL(dm_ydjh.pwfkry, '') != '' THEN 1 ELSE 0 END) AS pw_count,
SUM(CASE WHEN ISNULL(dm_ydjh.llfkrq, '') != '' THEN 1 ELSE 0 END) AS ll_count,
SUM(CASE WHEN ISNULL(dm_ydjh.hxfkrq, '') != '' THEN 1 ELSE 0 END) AS hx_count,
SUM(CASE WHEN ISNULL(dm_ydjh.qgfkrq, '') != '' THEN 1 ELSE 0 END) AS qg_count
FROM
dm_ydjh
where 1=1
<if test=" dcCh!=null and dcCh!=''">
and dm_ydjh.dc_ch=#{dcCh}
</if>
<if test=" zt!=null and zt!=''">
and dm_ydjh.zt=#{zt}
</if>
<if test="yf != null and yf!=''">
and dm_ydjh.jssj&gt;=#{yf}
</if>
<if test="yf != null and yf!=''">
and dm_ydjh.jssj&lt;=#{yf}
</if>
GROUP BY
dm_ydjh.dc_ch,
dm_ydjh.dc_pl,
dm_ydjh.jssj,
dm_ydjh.sljhrq,
dm_ydjh.pwjhrq,
dm_ydjh.lljhrq,
dm_ydjh.hxjhrq,
dm_ydjh.qgjhrq
order by jssj,dc_ch,dc_pl,zl,lqlb
</select>
</mapper>

Loading…
Cancel
Save