|
@@ -83,17 +83,37 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
|
|
|
System.out.println(cCode);
|
|
|
}
|
|
|
|
|
|
- @DS("master3")
|
|
|
+ @DS("master1")
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public Map<String,Object> propellingThree(IncidentTicket incidentTicket,IncidentTicketChildren children) {
|
|
|
+ public Map<String,Object> propellingOne(IncidentTicket incidentTicket,IncidentTicketChildren children) {
|
|
|
Map<String,Object> resMap = new HashMap<>();
|
|
|
resMap.put("res","false");
|
|
|
+
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ String accidentType = children.getAccidentType();//事故类型 应补(负数) 扣款 正数 不涉及金额(0)
|
|
|
+ String accidentNumber = incidentTicket.getAccidentNumber();//质量事故单号
|
|
|
+ map.put("cPBVMemo", accidentNumber);//质量事故单号
|
|
|
+ if(accidentType.equals("不涉及金额")){
|
|
|
+ resMap.put("res","noneTrue");
|
|
|
+ return resMap;
|
|
|
+ }else if(accidentType.equals("扣款")){
|
|
|
+ map.put("bNegative", 1);//负发票标志 0蓝字 1红字
|
|
|
+
|
|
|
+ }else if(accidentType.equals("应补")){
|
|
|
+ map.put("bNegative", 0);//负发票标志 0蓝字 1红字
|
|
|
+
|
|
|
+ }else{
|
|
|
+ resMap.put("msg","事故类型有误:"+accidentType);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String businessType = incidentTicket.getBusinessType();//业务类型
|
|
|
String moneyType = incidentTicket.getMoneyType();//币种
|
|
|
String accidentData = incidentTicket.getAccidentData();//日期
|
|
|
- String factory = incidentTicket.getFactory();//工厂
|
|
|
+// String factory = incidentTicket.getFactory();//工厂
|
|
|
String responsibilityCompany = incidentTicket.getResponsibilityCompany();//责任单位
|
|
|
|
|
|
String exchangeRate = children.getExchangeRate();//子表汇率
|
|
@@ -101,92 +121,86 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
|
|
|
String practicalSum = children.getPracticalSum();//实际事故金额
|
|
|
String zhanghaoId = children.getZhanghaoId();//账套
|
|
|
|
|
|
- Map<String,Object> factoryMap = incidentTicketMapper.getVendor(factory);
|
|
|
+// Map<String,Object> factoryMap = incidentTicketMapper.getVendor(factory);
|
|
|
Map<String,Object> responsibilityCompanyMap = incidentTicketMapper.getVendor(responsibilityCompany);
|
|
|
|
|
|
- if(factoryMap == null){
|
|
|
- resMap.put("msg",zhanghaoId+"账套不存在工厂 "+factory);
|
|
|
- return resMap;
|
|
|
- }
|
|
|
+// if(factoryMap == null){
|
|
|
+// resMap.put("msg",zhanghaoId+"账套不存在工厂 "+factory);
|
|
|
+// return resMap;
|
|
|
+// }
|
|
|
if(responsibilityCompanyMap == null){
|
|
|
resMap.put("msg",zhanghaoId+"账套不存在责任单位 "+responsibilityCompany);
|
|
|
return resMap;
|
|
|
}
|
|
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
+
|
|
|
//推送正文
|
|
|
/**
|
|
|
* 主表
|
|
|
*/
|
|
|
map.put("cPBVBillType","03");//发票类型 03
|
|
|
- String cCode = "test";
|
|
|
-// String cCode=this.addOne(incidentTicketMapper.getMaxCode("cPBVCode","PurBillVouch","cpbvcode"));
|
|
|
-// incidentTicketMapper.updateVoucherHistoryCNumber(this.maxNumber(cCode),"2502");
|
|
|
|
|
|
- map.put("cPBVCode",cCode);//采购发票号 生成
|
|
|
- if(StringUtils.isNotBlank(businessType) && businessType.equals("委外加工")){
|
|
|
+ map.put("iVTid", 131586);//单据模版号
|
|
|
+ if(businessType.equals("委外加工")){
|
|
|
map.put("cPTCode","02");//采购类型编码 01普通采购 02委外加工
|
|
|
- }else{
|
|
|
+ map.put("cBusType", "委外加工");//业务类型 普通采购/委外加工
|
|
|
+ map.put("cSource", "委外");//单据来源 采购、委外
|
|
|
+ }else if(businessType.equals("普通采购")){
|
|
|
map.put("cPTCode","01");//采购类型编码 01普通采购 02委外加工
|
|
|
+ map.put("cBusType", "普通采购");//业务类型 普通采购/委外加工
|
|
|
+ map.put("cSource", "采购");//单据来源 采购、委外
|
|
|
+ }else{
|
|
|
+ resMap.put("msg","业务类型有误 :"+businessType);
|
|
|
+ return resMap;
|
|
|
}
|
|
|
+
|
|
|
map.put("dPBVDate", DateUtils.getDate("yyyy-MM-dd"));//开票日期 当前日期
|
|
|
- String cVenCode = factoryMap.get("cVenCode").toString();
|
|
|
+ String cVenCode = responsibilityCompanyMap.get("cVenCode").toString();
|
|
|
map.put("cVenCode", cVenCode);//供应商编码 对接质量事故单责任单位(U8显示简称即可)
|
|
|
String cUnitCode = responsibilityCompanyMap.get("cVenCode").toString();
|
|
|
map.put("cUnitCode", cUnitCode);//代垫单位编码 供应商
|
|
|
map.put("cexch_name", moneyType);//人民币、美元
|
|
|
-// map.put("cExchRate", exchangeRate);//汇率 子表汇率
|
|
|
- map.put("cExchRate", 12);//汇率 子表汇率
|
|
|
- map.put("iPBVTaxRate", 0.0);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
- if(StringUtils.isNotBlank(businessType)){
|
|
|
- map.put("cBusType", businessType);//业务类型 普通采购/委外加工
|
|
|
- }else{
|
|
|
- map.put("cBusType", "普通采购");//业务类型 普通采购/委外加工
|
|
|
- }
|
|
|
+ map.put("cExchRate", exchangeRate);//汇率 子表汇率
|
|
|
+ map.put("iPBVTaxRate", 0);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
|
|
|
map.put("cPBVMaker", sysUser.getRealname());//创建人 推送人姓名
|
|
|
- map.put("bNegative", 0);//负发票标志 0
|
|
|
+
|
|
|
map.put("bOriginal", 0);//采购期初标志 0
|
|
|
map.put("bFirst", 0);//应付期初标志 0
|
|
|
map.put("iNetLock", 0);//现无用 0
|
|
|
map.put("cDefine2", planNumber);//计划单号 计划单号
|
|
|
map.put("dVouDate", accidentData);//单据日期 日期
|
|
|
- map.put("iVTid", 8167);//单据模版号 8167
|
|
|
+
|
|
|
// map.put("ufts", DateUtils.getTimestamp());//时间戳
|
|
|
-// map.put("cSource", businessType);//单据来源 采购、委外
|
|
|
- map.put("cSource", "采购");//单据来源 采购、委外
|
|
|
- map.put("cDefine12", factory);//江苏康弘纺织品有限公司
|
|
|
+
|
|
|
+ map.put("cDefine12", responsibilityCompany);//江苏康弘纺织品有限公司
|
|
|
map.put("cDefine13", responsibilityCompany);//江苏康弘纺织品有限公司
|
|
|
map.put("iDiscountTaxType",0);//扣税类别(0应税外加,1应税内含) 0
|
|
|
map.put("bCredit",0);//是否为立账依据0
|
|
|
String cVenAccount = "";
|
|
|
String cVenBank = "";
|
|
|
- if(factoryMap.get("cVenAccount") != null){
|
|
|
- cVenAccount = factoryMap.get("cVenAccount").toString();
|
|
|
+ if(responsibilityCompanyMap.get("cVenAccount") != null){
|
|
|
+ cVenAccount = responsibilityCompanyMap.get("cVenAccount").toString();
|
|
|
}
|
|
|
- if(factoryMap.get("cVenBank") != null){
|
|
|
- cVenBank = factoryMap.get("cVenBank").toString();
|
|
|
+ if(responsibilityCompanyMap.get("cVenBank") != null){
|
|
|
+ cVenBank = responsibilityCompanyMap.get("cVenBank").toString();
|
|
|
}
|
|
|
map.put("cVenAccount",cVenAccount);//供方银行账号
|
|
|
map.put("cVenBank",cVenBank);//供方银行名称
|
|
|
map.put("iPrintCount",0);//打印次数 0
|
|
|
String cVenContactCode = "";
|
|
|
String cVenPerson = "";
|
|
|
- if(factoryMap.get("cVenContactCode") != null){
|
|
|
- cVenContactCode = factoryMap.get("cVenContactCode").toString();
|
|
|
+ if(responsibilityCompanyMap.get("cVenContactCode") != null){
|
|
|
+ cVenContactCode = responsibilityCompanyMap.get("cVenContactCode").toString();
|
|
|
}
|
|
|
- if(factoryMap.get("cVenPerson") != null){
|
|
|
- cVenPerson = factoryMap.get("cVenPerson").toString();
|
|
|
+ if(responsibilityCompanyMap.get("cVenPerson") != null){
|
|
|
+ cVenPerson = responsibilityCompanyMap.get("cVenPerson").toString();
|
|
|
}
|
|
|
map.put("cContactCode",cVenContactCode);//供方联系人编码
|
|
|
map.put("cVenPerson",cVenPerson);//供方联系人
|
|
|
map.put("IsWfControlled",0);//是否工作流控制 0
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
- sb.append("||puzl|");
|
|
|
- sb.append(cCode);
|
|
|
- map.put("csysbarcode",sb.toString());//单据条码 ||puzl|0000001185
|
|
|
- map.put("cmaketime",DateUtils.now());//制单时间
|
|
|
|
|
|
+ map.put("cmaketime",DateUtils.now());//制单时间
|
|
|
|
|
|
/**
|
|
|
* 子表
|
|
@@ -194,154 +208,488 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
|
|
|
Map<String,Object> map2 = new HashMap<>();
|
|
|
|
|
|
|
|
|
-
|
|
|
map2.put("cInvCode","N3000002424");//存货编码
|
|
|
map2.put("bExBill",1);//是否为费用 1
|
|
|
// map2.put("iPBVQuantity","1");//数量
|
|
|
- //税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
- if(StringUtils.isNotBlank(practicalSum)){
|
|
|
|
|
|
- }else{
|
|
|
- map2.put("iOriMoney",0);//原币金额 -- 原币无税金额=原币金额/(1+税率)
|
|
|
- }
|
|
|
-
|
|
|
- map2.put("iOriSum",practicalSum);//原币价税合计 --实际事故金额
|
|
|
- map2.put("iOriTaxPrice",0);//原币税额 原币金额-原币无税金额
|
|
|
- map2.put("iMoney",practicalSum);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
- map2.put("iSum",practicalSum);//本币价税合计 原币金额*汇率
|
|
|
- map2.put("iTaxPrice",practicalSum);//本币税额 本币金额-本币无税金额
|
|
|
- map2.put("iTaxRate",0);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
- map2.put("ivouchrowno",1);//行号
|
|
|
- map2.put("cbsysbarcode",sb.toString()+"|1");//行条码 ||puzl|0000001185|1
|
|
|
- map2.put("bgift",0);//是否赠品 0
|
|
|
-
|
|
|
-// int chId = incidentTicketMapper.getMaxCode2();
|
|
|
-// map.put("pbvid",chId+1);//主表主键
|
|
|
-// incidentTicketMapper.insertPurBillVouch(map);
|
|
|
-//
|
|
|
-// int chIds = incidentTicketMapper.getMaxCode3();
|
|
|
-// map2.put("pbvid",chId+1);//主表主键
|
|
|
-// map2.put("id",chIds+1);//主键
|
|
|
-// incidentTicketMapper.insertPurBillVouchs(map2);
|
|
|
+ try {
|
|
|
|
|
|
+ //税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
+ BigDecimal sl = new BigDecimal("1");//税率
|
|
|
+ BigDecimal hl = new BigDecimal(exchangeRate);//汇率
|
|
|
+ //原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ BigDecimal iOriMoney = new BigDecimal(practicalSum).divide(sl,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ //原币税额 原币金额-原币无税金额
|
|
|
+ BigDecimal iOriTaxPrice = new BigDecimal(practicalSum).subtract(iOriMoney);
|
|
|
+ //本币价税合计 原币金额*汇率
|
|
|
+ BigDecimal iSum = new BigDecimal(practicalSum).multiply(hl);
|
|
|
+ //本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ BigDecimal iMoney = iSum.divide(sl,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ //本币税额 本币金额-本币无税金额
|
|
|
+ BigDecimal iTaxPrice = iSum.subtract(iMoney);
|
|
|
+
|
|
|
+ if(accidentType.equals("不涉及金额")){
|
|
|
+ map2.put("iOriMoney",0);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum",0);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriSum",0);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice",0);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum",0);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney",0);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice",0);//本币税额 本币金额-本币无税金额
|
|
|
+ }else if(accidentType.equals("扣款")){
|
|
|
+ map2.put("iOriMoney","-"+iOriMoney);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum","-"+practicalSum);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice","-"+iOriTaxPrice);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iOriTaxPrice",0);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum","-"+iSum);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney","-"+iMoney);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice",0);//本币税额 本币金额-本币无税金额
|
|
|
+
|
|
|
+ }else if(accidentType.equals("应补")){
|
|
|
+ map2.put("iOriMoney",iOriMoney);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum",practicalSum);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice",0);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum",iSum);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney",iMoney);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice",0);//本币税额 本币金额-本币无税金额
|
|
|
+ }else{
|
|
|
+ resMap.put("msg","事故类型有误:"+accidentType);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ map2.put("iTaxRate",0);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
+ map2.put("ivouchrowno",1);//行号
|
|
|
+
|
|
|
+ map2.put("bgift",0);//是否赠品 0
|
|
|
+
|
|
|
+ String cCode=this.addOne(incidentTicketMapper.getMaxCode("cPBVCode","PurBillVouch","cpbvcode"));
|
|
|
+ incidentTicketMapper.updateVoucherHistoryCNumber(this.maxNumber(cCode),"2502");
|
|
|
+
|
|
|
+ map.put("cPBVCode",cCode);//采购发票号 生成
|
|
|
+ resMap.put("cCode",cCode);
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ sb.append("||puzl|");
|
|
|
+ sb.append(cCode);
|
|
|
+ map.put("csysbarcode",sb.toString());//单据条码 ||puzl|0000001185
|
|
|
+ map2.put("cbsysbarcode",sb.toString()+"|1");//行条码 ||puzl|0000001185|1
|
|
|
+
|
|
|
+ int chId = incidentTicketMapper.getMaxCode2();
|
|
|
+ map.put("pbvid",chId+1);//主表主键
|
|
|
+ incidentTicketMapper.insertPurBillVouch(map);
|
|
|
+
|
|
|
+ int chIds = incidentTicketMapper.getMaxCode3();
|
|
|
+ map2.put("pbvid",chId+1);//主表主键
|
|
|
+ map2.put("id",chIds+1);//主键
|
|
|
+ incidentTicketMapper.insertPurBillVouchs(map2);
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ resMap.put("msg","同步数据有误,请联系管理员");
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ resMap.put("res","true");
|
|
|
return resMap;
|
|
|
}
|
|
|
|
|
|
- @DS("master3")
|
|
|
+ @DS("master2")
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public Result<?> propelling(IncidentTicket incidentTicket){
|
|
|
+ public Map<String,Object> propellingTwo(IncidentTicket incidentTicket,IncidentTicketChildren children) {
|
|
|
+ Map<String,Object> resMap = new HashMap<>();
|
|
|
+ resMap.put("res","false");
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
|
|
|
- if(!incidentTicket.getState().equals("3")){//1未处理 2已通知 3通知已反馈 4已推送 5已完结
|
|
|
- return Result.error("此单据状态下无法推送");
|
|
|
+ String accidentType = children.getAccidentType();//事故类型 应补(负数) 扣款 正数 不涉及金额(0)
|
|
|
+ String accidentNumber = incidentTicket.getAccidentNumber();//质量事故单号
|
|
|
+ map.put("cPBVMemo", accidentNumber);//质量事故单号
|
|
|
+ if(accidentType.equals("不涉及金额")){
|
|
|
+ resMap.put("res","noneTrue");
|
|
|
+ return resMap;
|
|
|
+ }else if(accidentType.equals("扣款")){
|
|
|
+ map.put("bNegative", 1);//负发票标志 0蓝字 1红字
|
|
|
+ }else if(accidentType.equals("应补")){
|
|
|
+ map.put("bNegative", 0);//负发票标志 0蓝字 1红字
|
|
|
+ }else{
|
|
|
+ resMap.put("msg","事故类型有误:"+accidentType);
|
|
|
+ return resMap;
|
|
|
}
|
|
|
- LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
-
|
|
|
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String businessType = incidentTicket.getBusinessType();//业务类型
|
|
|
String moneyType = incidentTicket.getMoneyType();//币种
|
|
|
String accidentData = incidentTicket.getAccidentData();//日期
|
|
|
- String factory = incidentTicket.getFactory();//工厂
|
|
|
+// String factory = incidentTicket.getFactory();//工厂
|
|
|
String responsibilityCompany = incidentTicket.getResponsibilityCompany();//责任单位
|
|
|
- List<IncidentTicketChildren> childrenList = incidentTicketChildrenMapper.selectByMainId(incidentTicket.getId());
|
|
|
|
|
|
- for (IncidentTicketChildren children:childrenList){
|
|
|
+ String exchangeRate = children.getExchangeRate();//子表汇率
|
|
|
+ String planNumber = children.getPlanNumber();//计划单号
|
|
|
+ String practicalSum = children.getPracticalSum();//实际事故金额
|
|
|
+ String zhanghaoId = children.getZhanghaoId();//账套
|
|
|
|
|
|
- String exchangeRate = children.getExchangeRate();//子表汇率
|
|
|
- String planNumber = children.getPlanNumber();//计划单号
|
|
|
- String practicalSum = children.getPracticalSum();//实际事故金额
|
|
|
+// Map<String,Object> factoryMap = incidentTicketMapper.getVendor(factory);
|
|
|
+ Map<String,Object> responsibilityCompanyMap = incidentTicketMapper.getVendor(responsibilityCompany);
|
|
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
- //推送正文
|
|
|
- /**
|
|
|
- * 主表
|
|
|
- */
|
|
|
- map.put("cPBVBillType","03");//发票类型 03
|
|
|
+ if(responsibilityCompanyMap == null){
|
|
|
+ resMap.put("msg",zhanghaoId+"账套不存在责任单位 "+responsibilityCompany);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
|
|
|
- String cCode=this.addOne(incidentTicketMapper.getMaxCode("cPBVCode","PurBillVouch","cmaketime"));
|
|
|
- incidentTicketMapper.updateVoucherHistoryCNumber(this.maxNumber(cCode),"2502");
|
|
|
|
|
|
- map.put("PBVID","2"+cCode);//采购发票主表标识
|
|
|
- map.put("cPBVCode",cCode);//采购发票号 生成
|
|
|
- if(businessType.equals("普通采购")){
|
|
|
- map.put("cPTCode","01");//采购类型编码 01普通采购 02委外加工
|
|
|
- }else{
|
|
|
- map.put("cPTCode","02");//采购类型编码 01普通采购 02委外加工
|
|
|
- }
|
|
|
- map.put("dPBVDate", DateUtils.getDate("yyyy-MM-dd"));//开票日期 当前日期
|
|
|
- map.put("cVenCode", "0001");//供应商编码 对接质量事故单责任单位(U8显示简称即可)
|
|
|
- map.put("cUnitCode", "0001");//代垫单位编码 供应商
|
|
|
- map.put("cexch_name", moneyType);//人民币、美元
|
|
|
-// map.put("cExchRate", exchangeRate);//汇率 子表汇率
|
|
|
- map.put("cExchRate", 12.0);//汇率 子表汇率
|
|
|
- map.put("iPBVTaxRate", 0);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
- if(StringUtils.isNotBlank(businessType)){
|
|
|
- map.put("cBusType", businessType);//业务类型 普通采购/委外加工
|
|
|
+ //推送正文
|
|
|
+ /**
|
|
|
+ * 主表
|
|
|
+ */
|
|
|
+ map.put("cPBVBillType","03");//发票类型 03
|
|
|
+
|
|
|
+ map.put("iVTid", 131601);//单据模版号
|
|
|
+ if(businessType.equals("委外加工")){
|
|
|
+ map.put("cPTCode","02");//采购类型编码 01普通采购 02委外加工
|
|
|
+ map.put("cBusType", "委外加工");//业务类型 普通采购/委外加工
|
|
|
+ map.put("cSource", "委外");//单据来源 采购、委外
|
|
|
+ }else if(businessType.equals("普通采购")){
|
|
|
+ map.put("cPTCode","01");//采购类型编码 01普通采购 02委外加工
|
|
|
+ map.put("cBusType", "普通采购");//业务类型 普通采购/委外加工
|
|
|
+ map.put("cSource", "采购");//单据来源 采购、委外
|
|
|
+ }else{
|
|
|
+ resMap.put("msg","业务类型有误 :"+businessType);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+ map.put("dPBVDate", DateUtils.getDate("yyyy-MM-dd"));//开票日期 当前日期
|
|
|
+ String cVenCode = responsibilityCompanyMap.get("cVenCode").toString();
|
|
|
+ map.put("cVenCode", cVenCode);//供应商编码 对接质量事故单责任单位(U8显示简称即可)
|
|
|
+ String cUnitCode = responsibilityCompanyMap.get("cVenCode").toString();
|
|
|
+ map.put("cUnitCode", cUnitCode);//代垫单位编码 供应商
|
|
|
+ map.put("cexch_name", moneyType);//人民币、美元
|
|
|
+ map.put("cExchRate", exchangeRate);//汇率 子表汇率
|
|
|
+ map.put("iPBVTaxRate", 13);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
+
|
|
|
+ map.put("cPBVMaker", sysUser.getRealname());//创建人 推送人姓名
|
|
|
+
|
|
|
+ map.put("bOriginal", 0);//采购期初标志 0
|
|
|
+ map.put("bFirst", 0);//应付期初标志 0
|
|
|
+ map.put("iNetLock", 0);//现无用 0
|
|
|
+ map.put("cDefine2", planNumber);//计划单号 计划单号
|
|
|
+ map.put("dVouDate", accidentData);//单据日期 日期
|
|
|
+
|
|
|
+// map.put("ufts", DateUtils.getTimestamp());//时间戳
|
|
|
+
|
|
|
+ map.put("cDefine12", responsibilityCompany);//江苏康弘纺织品有限公司
|
|
|
+ map.put("cDefine13", responsibilityCompany);//江苏康弘纺织品有限公司
|
|
|
+ map.put("iDiscountTaxType",0);//扣税类别(0应税外加,1应税内含) 0
|
|
|
+ map.put("bCredit",0);//是否为立账依据0
|
|
|
+ String cVenAccount = "";
|
|
|
+ String cVenBank = "";
|
|
|
+ if(responsibilityCompanyMap.get("cVenAccount") != null){
|
|
|
+ cVenAccount = responsibilityCompanyMap.get("cVenAccount").toString();
|
|
|
+ }
|
|
|
+ if(responsibilityCompanyMap.get("cVenBank") != null){
|
|
|
+ cVenBank = responsibilityCompanyMap.get("cVenBank").toString();
|
|
|
+ }
|
|
|
+ map.put("cVenAccount",cVenAccount);//供方银行账号
|
|
|
+ map.put("cVenBank",cVenBank);//供方银行名称
|
|
|
+ map.put("iPrintCount",0);//打印次数 0
|
|
|
+ String cVenContactCode = "";
|
|
|
+ String cVenPerson = "";
|
|
|
+ if(responsibilityCompanyMap.get("cVenContactCode") != null){
|
|
|
+ cVenContactCode = responsibilityCompanyMap.get("cVenContactCode").toString();
|
|
|
+ }
|
|
|
+ if(responsibilityCompanyMap.get("cVenPerson") != null){
|
|
|
+ cVenPerson = responsibilityCompanyMap.get("cVenPerson").toString();
|
|
|
+ }
|
|
|
+ map.put("cContactCode",cVenContactCode);//供方联系人编码
|
|
|
+ map.put("cVenPerson",cVenPerson);//供方联系人
|
|
|
+ map.put("IsWfControlled",0);//是否工作流控制 0
|
|
|
+
|
|
|
+ map.put("cmaketime",DateUtils.now());//制单时间
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 子表
|
|
|
+ */
|
|
|
+ Map<String,Object> map2 = new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+ map2.put("cInvCode","N3000002424");//存货编码
|
|
|
+ map2.put("bExBill",1);//是否为费用 1
|
|
|
+// map2.put("iPBVQuantity","1");//数量
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ //税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
+ BigDecimal sl = new BigDecimal("1.13");//税率
|
|
|
+ BigDecimal hl = new BigDecimal(exchangeRate);//汇率
|
|
|
+ //原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ BigDecimal iOriMoney = new BigDecimal(practicalSum).divide(sl,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ //原币税额 原币金额-原币无税金额
|
|
|
+ BigDecimal iOriTaxPrice = new BigDecimal(practicalSum).subtract(iOriMoney);
|
|
|
+ //本币价税合计 原币金额*汇率
|
|
|
+ BigDecimal iSum = new BigDecimal(practicalSum).multiply(hl);
|
|
|
+ //本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ BigDecimal iMoney = iSum.divide(sl,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ //本币税额 本币金额-本币无税金额
|
|
|
+ BigDecimal iTaxPrice = iSum.subtract(iMoney);
|
|
|
+
|
|
|
+ if(accidentType.equals("不涉及金额")){
|
|
|
+ map2.put("iOriMoney",0);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum",0);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriSum",0);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice",0);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum",0);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney",0);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice",0);//本币税额 本币金额-本币无税金额
|
|
|
+ }else if(accidentType.equals("扣款")){
|
|
|
+ map2.put("iOriMoney","-"+iOriMoney);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum","-"+practicalSum);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice","-"+iOriTaxPrice);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum","-"+iSum);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney","-"+iMoney);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice","-"+iTaxPrice);//本币税额 本币金额-本币无税金额
|
|
|
+
|
|
|
+ }else if(accidentType.equals("应补")){
|
|
|
+ map2.put("iOriMoney",iOriMoney);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum",practicalSum);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice",iOriTaxPrice);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum",iSum);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney",iMoney);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice",iTaxPrice);//本币税额 本币金额-本币无税金额
|
|
|
}else{
|
|
|
- map.put("cBusType", "普通采购");//业务类型 普通采购/委外加工
|
|
|
+ resMap.put("msg","事故类型有误:"+accidentType);
|
|
|
+ return resMap;
|
|
|
}
|
|
|
|
|
|
- map.put("cPBVMaker", sysUser.getRealname());//创建人 推送人姓名
|
|
|
- map.put("bNegative", 0);//负发票标志 0
|
|
|
- map.put("bOriginal", 0);//采购期初标志 0
|
|
|
- map.put("bFirst", 0);//应付期初标志 0
|
|
|
- map.put("iNetLock", 0);//现无用 0
|
|
|
- map.put("cDefine2", planNumber);//计划单号 计划单号
|
|
|
- map.put("dVouDate", accidentData);//单据日期 日期
|
|
|
- map.put("iVTid", "8167");//单据模版号 8167
|
|
|
-// map.put("ufts", DateUtils.getTimestamp());//时间戳
|
|
|
- map.put("cSource", businessType);//单据来源 采购、委外
|
|
|
- map.put("cDefine12", factory);//江苏康弘纺织品有限公司
|
|
|
- map.put("cDefine13", responsibilityCompany);//江苏康弘纺织品有限公司
|
|
|
- map.put("iDiscountTaxType",0);//扣税类别(0应税外加,1应税内含) 0
|
|
|
- map.put("bCredit",0);//是否为立账依据0
|
|
|
- map.put("cVenAccount","1112333333333");//供方银行账号
|
|
|
- map.put("cVenBank","中国银行");//供方银行名称
|
|
|
- map.put("iPrintCount",0);//打印次数 0
|
|
|
- map.put("cContactCode","0001");//供方联系人编码
|
|
|
- map.put("cVenPerson","同步");//供方联系人
|
|
|
- map.put("IsWfControlled",0);//是否工作流控制 0
|
|
|
+ map2.put("iTaxRate",13);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
+ map2.put("ivouchrowno",1);//行号
|
|
|
+
|
|
|
+ map2.put("bgift",0);//是否赠品 0
|
|
|
+
|
|
|
+ String cCode=this.addOne(incidentTicketMapper.getMaxCode("cPBVCode","PurBillVouch","cpbvcode"));
|
|
|
+ incidentTicketMapper.updateVoucherHistoryCNumber(this.maxNumber(cCode),"2502");
|
|
|
+
|
|
|
+ map.put("cPBVCode",cCode);//采购发票号 生成
|
|
|
+ resMap.put("cCode",cCode);
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
sb.append("||puzl|");
|
|
|
sb.append(cCode);
|
|
|
map.put("csysbarcode",sb.toString());//单据条码 ||puzl|0000001185
|
|
|
- map.put("cmaketime",DateUtils.now());//制单时间
|
|
|
+ map2.put("cbsysbarcode",sb.toString()+"|1");//行条码 ||puzl|0000001185|1
|
|
|
+
|
|
|
+ int chId = incidentTicketMapper.getMaxCode2();
|
|
|
+ map.put("pbvid",chId+1);//主表主键
|
|
|
+ incidentTicketMapper.insertPurBillVouch(map);
|
|
|
+
|
|
|
+ int chIds = incidentTicketMapper.getMaxCode3();
|
|
|
+ map2.put("pbvid",chId+1);//主表主键
|
|
|
+ map2.put("id",chIds+1);//主键
|
|
|
+ incidentTicketMapper.insertPurBillVouchs(map2);
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ resMap.put("msg","同步数据有误,请联系管理员");
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ resMap.put("res","true");
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @DS("master3")
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public Map<String,Object> propellingThree(IncidentTicket incidentTicket,IncidentTicketChildren children) {
|
|
|
+ Map<String,Object> resMap = new HashMap<>();
|
|
|
+
|
|
|
+ //主表数据
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ resMap.put("res","false");
|
|
|
+
|
|
|
+ String accidentType = children.getAccidentType();//事故类型 应补(负数) 扣款 正数 不涉及金额(0)
|
|
|
+ String accidentNumber = incidentTicket.getAccidentNumber();//质量事故单号
|
|
|
+ map.put("cPBVMemo", accidentNumber);//质量事故单号
|
|
|
+ if(accidentType.equals("不涉及金额")){
|
|
|
+ resMap.put("res","noneTrue");
|
|
|
+ return resMap;
|
|
|
+ }else if(accidentType.equals("扣款")){
|
|
|
+ map.put("bNegative", 1);//负发票标志 0蓝字 1红字
|
|
|
+
|
|
|
+ }else if(accidentType.equals("应补")){
|
|
|
+ map.put("bNegative", 0);//负发票标志 0蓝字 1红字
|
|
|
+
|
|
|
+ }else{
|
|
|
+ resMap.put("msg","事故类型有误:"+accidentType);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ String businessType = incidentTicket.getBusinessType();//业务类型
|
|
|
+ String moneyType = incidentTicket.getMoneyType();//币种
|
|
|
+ String accidentData = incidentTicket.getAccidentData();//日期
|
|
|
+// String factory = incidentTicket.getFactory();//工厂
|
|
|
+ String responsibilityCompany = incidentTicket.getResponsibilityCompany();//责任单位
|
|
|
+
|
|
|
+ String exchangeRate = children.getExchangeRate();//子表汇率
|
|
|
+ String planNumber = children.getPlanNumber();//计划单号
|
|
|
+ String practicalSum = children.getPracticalSum();//实际事故金额
|
|
|
+ String zhanghaoId = children.getZhanghaoId();//账套
|
|
|
+
|
|
|
+// Map<String,Object> factoryMap = incidentTicketMapper.getVendor(factory);
|
|
|
+ Map<String,Object> responsibilityCompanyMap = incidentTicketMapper.getVendor(responsibilityCompany);
|
|
|
+
|
|
|
+ if(responsibilityCompanyMap == null){
|
|
|
+ resMap.put("msg",zhanghaoId+"账套不存在责任单位 "+responsibilityCompany);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ //推送正文
|
|
|
+ /**
|
|
|
+ * 主表
|
|
|
+ */
|
|
|
+ map.put("cPBVBillType","03");//发票类型 03
|
|
|
+
|
|
|
+ map.put("iVTid", 8167);//单据模版号
|
|
|
+ if(businessType.equals("委外加工")){
|
|
|
+ map.put("cPTCode","02");//采购类型编码 01普通采购 02委外加工
|
|
|
+ map.put("cBusType", "委外加工");//业务类型 普通采购/委外加工
|
|
|
+ map.put("cSource", "委外");//单据来源 采购、委外
|
|
|
+ }else if(businessType.equals("普通采购")){
|
|
|
+ map.put("cPTCode","01");//采购类型编码 01普通采购 02委外加工
|
|
|
+ map.put("cBusType", "普通采购");//业务类型 普通采购/委外加工
|
|
|
+ map.put("cSource", "采购");//单据来源 采购、委外
|
|
|
+ }else{
|
|
|
+ resMap.put("msg","业务类型有误 :"+businessType);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+ map.put("dPBVDate", DateUtils.getDate("yyyy-MM-dd"));//开票日期 当前日期
|
|
|
+ String cVenCode = responsibilityCompanyMap.get("cVenCode").toString();
|
|
|
+ map.put("cVenCode", cVenCode);//供应商编码 对接质量事故单责任单位(U8显示简称即可)
|
|
|
+ String cUnitCode = responsibilityCompanyMap.get("cVenCode").toString();
|
|
|
+ map.put("cUnitCode", cUnitCode);//代垫单位编码 供应商
|
|
|
+ map.put("cexch_name", moneyType);//人民币、美元
|
|
|
+ map.put("cExchRate", exchangeRate);//汇率 子表汇率
|
|
|
+ map.put("iPBVTaxRate", 13);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
|
|
|
+ map.put("cPBVMaker", sysUser.getRealname());//创建人 推送人姓名
|
|
|
+ map.put("bOriginal", 0);//采购期初标志 0
|
|
|
+ map.put("bFirst", 0);//应付期初标志 0
|
|
|
+ map.put("iNetLock", 0);//现无用 0
|
|
|
+ map.put("cDefine2", planNumber);//计划单号 计划单号
|
|
|
+ map.put("dVouDate", accidentData);//单据日期 日期
|
|
|
+// map.put("ufts", DateUtils.getTimestamp());//时间戳
|
|
|
|
|
|
- /**
|
|
|
- * 子表
|
|
|
- */
|
|
|
- Map<String,Object> map2 = new HashMap<>();
|
|
|
+ map.put("cDefine12", responsibilityCompany);//江苏康弘纺织品有限公司
|
|
|
+ map.put("cDefine13", responsibilityCompany);//江苏康弘纺织品有限公司
|
|
|
+ map.put("iDiscountTaxType",0);//扣税类别(0应税外加,1应税内含) 0
|
|
|
+ map.put("bCredit",0);//是否为立账依据0
|
|
|
+ String cVenAccount = "";
|
|
|
+ String cVenBank = "";
|
|
|
+ if(responsibilityCompanyMap.get("cVenAccount") != null){
|
|
|
+ cVenAccount = responsibilityCompanyMap.get("cVenAccount").toString();
|
|
|
+ }
|
|
|
+ if(responsibilityCompanyMap.get("cVenBank") != null){
|
|
|
+ cVenBank = responsibilityCompanyMap.get("cVenBank").toString();
|
|
|
+ }
|
|
|
+ map.put("cVenAccount",cVenAccount);//供方银行账号
|
|
|
+ map.put("cVenBank",cVenBank);//供方银行名称
|
|
|
+ map.put("iPrintCount",0);//打印次数 0
|
|
|
+ String cVenContactCode = "";
|
|
|
+ String cVenPerson = "";
|
|
|
+ if(responsibilityCompanyMap.get("cVenContactCode") != null){
|
|
|
+ cVenContactCode = responsibilityCompanyMap.get("cVenContactCode").toString();
|
|
|
+ }
|
|
|
+ if(responsibilityCompanyMap.get("cVenPerson") != null){
|
|
|
+ cVenPerson = responsibilityCompanyMap.get("cVenPerson").toString();
|
|
|
+ }
|
|
|
+ map.put("cContactCode",cVenContactCode);//供方联系人编码
|
|
|
+ map.put("cVenPerson",cVenPerson);//供方联系人
|
|
|
+ map.put("IsWfControlled",0);//是否工作流控制 0
|
|
|
+
|
|
|
+ map.put("cmaketime",DateUtils.now());//制单时间
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 子表
|
|
|
+ */
|
|
|
+ Map<String,Object> map2 = new HashMap<>();
|
|
|
+
|
|
|
+ map2.put("cInvCode","N3000002424");//存货编码
|
|
|
+ map2.put("bExBill",1);//是否为费用 1
|
|
|
+// map2.put("iPBVQuantity","1");//数量
|
|
|
+
|
|
|
+ try {
|
|
|
|
|
|
- map2.put("pbvid",map.get("PBVID"));//主表主键
|
|
|
- map2.put("cInvCode","N3000002424");//存货编码
|
|
|
- map2.put("bExBill",1);//是否为费用 1
|
|
|
-// map2.put("iPBVQuantity","1");//数量
|
|
|
//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
- map2.put("iOriMoney",practicalSum);//原币金额 -- 原币无税金额=原币金额/(1+税率)
|
|
|
- map2.put("iOriSum",practicalSum);//原币价税合计 --实际事故金额
|
|
|
- map2.put("iOriTaxPrice",0);//原币税额 原币金额-原币无税金额
|
|
|
- map2.put("iMoney",practicalSum);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
- map2.put("iSum",practicalSum);//本币价税合计 原币金额*汇率
|
|
|
- map2.put("iTaxPrice",practicalSum);//本币税额 本币金额-本币无税金额
|
|
|
- map2.put("iTaxRate",0);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
+ BigDecimal sl = new BigDecimal("1.13");//税率
|
|
|
+ BigDecimal hl = new BigDecimal(exchangeRate);//汇率
|
|
|
+ //原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ BigDecimal iOriMoney = new BigDecimal(practicalSum).divide(sl,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ //原币税额 原币金额-原币无税金额
|
|
|
+ BigDecimal iOriTaxPrice = new BigDecimal(practicalSum).subtract(iOriMoney);
|
|
|
+ //本币价税合计 原币金额*汇率
|
|
|
+ BigDecimal iSum = new BigDecimal(practicalSum).multiply(hl);
|
|
|
+ //本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ BigDecimal iMoney = iSum.divide(sl,BigDecimal.ROUND_HALF_UP).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ //本币税额 本币金额-本币无税金额
|
|
|
+ BigDecimal iTaxPrice = iSum.subtract(iMoney);
|
|
|
+
|
|
|
+ if(accidentType.equals("不涉及金额")){
|
|
|
+ map2.put("iOriMoney",0);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum",0);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriSum",0);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice",0);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum",0);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney",0);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice",0);//本币税额 本币金额-本币无税金额
|
|
|
+ }else if(accidentType.equals("扣款")){
|
|
|
+ map2.put("iOriMoney","-"+iOriMoney);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum","-"+practicalSum);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice","-"+iOriTaxPrice);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum","-"+iSum);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney","-"+iMoney);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice","-"+iTaxPrice);//本币税额 本币金额-本币无税金额
|
|
|
+
|
|
|
+ }else if(accidentType.equals("应补")){
|
|
|
+ map2.put("iOriMoney",iOriMoney);//原币金额(无税) -- 原币无税金额=原币金额/(1+税率)
|
|
|
+ map2.put("iOriSum",practicalSum);//原币价税合计 --实际事故金额
|
|
|
+ map2.put("iOriTaxPrice",iOriTaxPrice);//原币税额 原币金额-原币无税金额
|
|
|
+ map2.put("iSum",iSum);//本币价税合计 原币金额*汇率
|
|
|
+ map2.put("iMoney",iMoney);//本币金额 (本币无税金额) 本币金额/(1+税率)
|
|
|
+ map2.put("iTaxPrice",iTaxPrice);//本币税额 本币金额-本币无税金额
|
|
|
+ }else{
|
|
|
+ resMap.put("msg","事故类型有误:"+accidentType);
|
|
|
+ return resMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ map2.put("iTaxRate",13);//税率(101默认为0,102/103默认为13,可取U8该字段设置的默认值)
|
|
|
map2.put("ivouchrowno",1);//行号
|
|
|
- map2.put("cbsysbarcode",sb.toString()+"|1");//行条码 ||puzl|0000001185|1
|
|
|
+
|
|
|
map2.put("bgift",0);//是否赠品 0
|
|
|
|
|
|
+ String cCode=this.addOne(incidentTicketMapper.getMaxCode("cPBVCode","PurBillVouch","cpbvcode"));
|
|
|
+ incidentTicketMapper.updateVoucherHistoryCNumber(this.maxNumber(cCode),"2502");
|
|
|
+
|
|
|
+ map.put("cPBVCode",cCode);//采购发票号 生成
|
|
|
+ resMap.put("cCode",cCode);
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ sb.append("||puzl|");
|
|
|
+ sb.append(cCode);
|
|
|
+ map.put("csysbarcode",sb.toString());//单据条码 ||puzl|0000001185
|
|
|
+ map2.put("cbsysbarcode",sb.toString()+"|1");//行条码 ||puzl|0000001185|1
|
|
|
+
|
|
|
+ int chId = incidentTicketMapper.getMaxCode2();
|
|
|
+ map.put("pbvid",chId+1);//主表主键
|
|
|
incidentTicketMapper.insertPurBillVouch(map);
|
|
|
+
|
|
|
+ int chIds = incidentTicketMapper.getMaxCode3();
|
|
|
+ map2.put("pbvid",chId+1);//主表主键
|
|
|
+ map2.put("id",chIds+1);//主键
|
|
|
incidentTicketMapper.insertPurBillVouchs(map2);
|
|
|
|
|
|
- children.setU8Invoice(cCode);
|
|
|
- incidentTicketChildrenMapper.updateById(children);
|
|
|
+ }catch (Exception e){
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ resMap.put("msg","同步数据有误,请联系管理员");
|
|
|
+ return resMap;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- incidentTicket.setState("4");
|
|
|
- incidentTicket.setUpdateBy(sysUser.getUsername());
|
|
|
- incidentTicket.setUpdateTime(new Date());
|
|
|
- incidentTicketMapper.updateById(incidentTicket);
|
|
|
- return Result.ok("已推送");
|
|
|
+ resMap.put("res","true");
|
|
|
+ return resMap;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -362,7 +710,7 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
|
|
|
|
|
|
for(String o:idList){
|
|
|
|
|
|
- sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),o,"质量事故单",code+" "+title, CommonConstant.MSG_CATEGORY_2,taskParam);
|
|
|
+ sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),o,"质量事故单 "+code,code+" "+title, CommonConstant.MSG_CATEGORY_2,taskParam);
|
|
|
IncidentTicketMsg incidentTicketMsg = new IncidentTicketMsg();
|
|
|
LoginUser loginUser = sysBaseAPI.getUserByName(o);
|
|
|
incidentTicketMsg.setPkIncidentTicket(headId);
|
|
@@ -422,13 +770,13 @@ public class IncidentTicketServiceImpl extends ServiceImpl<IncidentTicketMapper,
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
- if(!isAuth){
|
|
|
- return Result.error("您无权操作此事故单");
|
|
|
- }
|
|
|
+// if(!isAuth){
|
|
|
+// return Result.error("您无权操作此事故单");
|
|
|
+// }
|
|
|
|
|
|
HashMap<String,Object> taskParam = new HashMap<>();
|
|
|
|
|
|
- sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),"T0008","质量事故单",code+" "+title+" 财务对单人已处理完毕;", CommonConstant.MSG_CATEGORY_2,taskParam);
|
|
|
+ sysBaseAPI.sendSysAnnouncement(sysUser,sysUser.getUsername(),"T0008","质量事故单 "+code,code+" "+title+" 财务对单人已处理完毕;", CommonConstant.MSG_CATEGORY_2,taskParam);
|
|
|
|
|
|
// if(isComplete){
|
|
|
|