Helius
2021-04-19 ccdc5690f7f4705611a2f57a7cf45da352b6e7e4
zq-erp/src/main/java/com/matrix/system/dataMove/DateMoveServiceImpl.java
@@ -491,6 +491,11 @@
            shoppingGood.setIsDel(1);
            shoppingGood.setZjm(StringUtils.toHanyuPinyin(shoppingGood.getName()) + "," + StringUtils.toHeadWordHanyuPinyin(shoppingGood.getName()));
            if (shoppingGood.getCarUseCount() != null) {
                shoppingGood.setIsCourse("Y");
                shoppingGood.setIsInfinite("N");
            }
            shoppingGood.setWeiDescription("数据迁移-tc");
            List<ShoppingGoodsAssemble> assembleList = mapsToListBean(assembles, ShoppingGoodsAssemble.class);
@@ -1074,7 +1079,7 @@
                                                                            "\t\ta.balance,\n" +
                                                                            "\t\ta.remark,\n" +
                                                                            "        b.name projName,\n" +
                                                                            "        sum(a.SURPLUS_COUNT) SURPLUS_COUNT\n" +
                                                                            "        a.SURPLUS_COUNT\n" +
                                                                            "\t\tfrom sys_proj_use a\n" +
                                                                            "\t\tleft join shopping_goods b on a.TAOCAN_ID= b.ID\n" +
                                                                            "where TAOCAN_ID IS NOT NULL\n" +
@@ -1507,4 +1512,41 @@
        }
    }
    @Transactional(rollbackFor = Exception.class)
    public void tyOrderAndAchieveMove() {
        jdbcTemplate.update("update sys_order set orderType=1, is_has_refund=2 where 1=1");
        List<SysOrderFlow> flows = sysOrderFlowDao.selectOrderFlowByType();
        if (CollUtil.isNotEmpty(flows)) {
            for (SysOrderFlow flow : flows) {
                SysOrder sysOrder = sysOrderDao.selectById(flow.getOrderId());
                sysOrder.setIsHasRefund(1);
                sysOrderDao.update(sysOrder);
            }
        }
        List<AchieveNew> achieveNews = achieveNewDao.selectAchieveForOrder();
        if (CollUtil.isNotEmpty(achieveNews)) {
            for (AchieveNew achieveNew : achieveNews) {
                if ("现金业绩".equalsIgnoreCase(achieveNew.getAchieveType())) {
                    achieveNew.setPayMethod("现金");
                } else {
                    achieveNew.setPayMethod("划扣");
                }
//                if (achieveNew.getConsume() == null) {
//                    achieveNew.setPayMethod("现金");
//                } else {
//                    achieveNew.setPayMethod("划扣");
//                }
                achieveNew.setAchieveType("顾问业绩");
                achieveNew.setGoodsCash(Double.parseDouble(achieveNew.getT1()));
                achieveNewDao.updateByModel(achieveNew);
            }
        }
    }
}