|
@@ -3,6 +3,7 @@ package org.jeecg.modules.cost.service.impl;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.google.gson.JsonObject;
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
import org.jeecg.common.exception.JeecgBootException;
|
|
import org.jeecg.modules.cost.entity.*;
|
|
import org.jeecg.modules.cost.entity.*;
|
|
import org.jeecg.modules.cost.mapper.*;
|
|
import org.jeecg.modules.cost.mapper.*;
|
|
@@ -14,8 +15,10 @@ import org.springframework.beans.BeansException;
|
|
import org.springframework.context.ApplicationContext;
|
|
import org.springframework.context.ApplicationContext;
|
|
import org.springframework.context.ApplicationContextAware;
|
|
import org.springframework.context.ApplicationContextAware;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import springfox.documentation.spring.web.json.Json;
|
|
|
|
|
|
import java.io.Serializable;
|
|
import java.io.Serializable;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -37,6 +40,8 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
@Autowired
|
|
@Autowired
|
|
private SyCostAllocationMapper syCostAllocationMapper;
|
|
private SyCostAllocationMapper syCostAllocationMapper;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private SyCostJsonMapper syCostJsonMapper;
|
|
|
|
+ @Autowired
|
|
private SyCostAllocationAccidentMapper syCostAllocationAccidentMapper;
|
|
private SyCostAllocationAccidentMapper syCostAllocationAccidentMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private SyCostAllocationCostpayMapper syCostAllocationCostpayMapper;
|
|
private SyCostAllocationCostpayMapper syCostAllocationCostpayMapper;
|
|
@@ -92,6 +97,24 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
|
|
syCostAllocationShipdetailMapper.insert(entity);
|
|
syCostAllocationShipdetailMapper.insert(entity);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //@Scheduled(cron = "0 43 16 * * ?")
|
|
|
|
+ public void saveMain(String plannum, JSONObject json) {
|
|
|
|
+ //方法1:后台使用string接受数据,数据库用json接受数据,但是这个添加字符串也会添加成功
|
|
|
|
+/* String string = "{\"accidentUsdamount\": null,\"accidentcnyAmount\": null,\"actualShipquantity\": 25990,\"billstatus\": null,\"createBy\": null,\"createTime\": null,\"customerShortame\": \"PMK\",\"delFlag\": null,\"department\": \"业务四部\",\"excipiencostIncludestax\": 6654511.49,\"excipiencostNotincludestax\": 0,\"exportSales\": \"兰春梅\",\"fabriccostIncludestax\": null,\"fabriccostNotincludestax\": null,\"fabricshortcost\": null,\"garmentContractno\": \"AW22-PRIMARK-24583a\",\"id\": null,\"outdata\": \"2022-02-25 00:00:00\",\"pkOrg\": null,\"planNum\": \"\",\"planQuantity\": 25990,\"poStyleNum\": \"秋冬男童2B拼块网眼布polo衫\",\"preparedBy\": \"兰春梅\",\"processUnit\": \"FASHIONTEX APPAREL CO LTD\",\"processUnitList\": [1,2,3],\"remarks\": null,\"remarksTwo\": null,\"rmbExpense\": 1607.79,\"rmbExportamount\": 406950.35,\"rmbProcesscost\": 0,\"salesordersLocaltotal\": 387513.66,\"salesrrdersOriginaltotal\": 61045,\"shortseveral\": 0,\"shortvalue\": null,\"syCostAllocationAccidentList\": null,\"syCostAllocationCostpayList\": [{\"id\": null, \"syCostAllocationId\": null, \"createBy\": null, \"createTime\": null, \"updateBy\": null}],\"taxrate\": null,\"updateBy\": null,\"updateTime\": null,\"usdExpense\": 10754.34,\"usdProcesscost\": null,\"usdTotalexportprice\": 61045,\"success\": true,\"timestamp\": 1665641607070}";
|
|
|
|
+ JSONObject object = JSONObject
|
|
|
|
+ .parseObject(string);
|
|
|
|
+ String json = object.toJSONString();
|
|
|
|
+ SyCostJson cost = new SyCostJson();
|
|
|
|
+ cost.setPlanNum("测试");
|
|
|
|
+ cost.setCostInfo(json);
|
|
|
|
+ syCostJsonMapper.insert(cost);*/
|
|
|
|
+
|
|
|
|
+ String info = json.toJSONString();
|
|
|
|
+ SyCostJson cost = new SyCostJson();
|
|
|
|
+ cost.setPlanNum(plannum);
|
|
|
|
+ cost.setCostInfo(info);
|
|
|
|
+ syCostJsonMapper.insert(cost);
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|