|
@@ -19,6 +19,7 @@ import javax.xml.namespace.QName;
|
|
|
import javax.xml.ws.Service;
|
|
|
|
|
|
import com.alibaba.druid.support.json.JSONUtils;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
@@ -362,10 +363,10 @@ public class FbsWorkingStatisticsController {
|
|
|
return new ResponseEntity<ResHttpStatus>(res, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- String[] batchCode = entity.getBatchCode().split(",");
|
|
|
- if(batchCode.length > 0){
|
|
|
- entity.setQualifiedNumber(String.valueOf(batchCode.length));
|
|
|
- }
|
|
|
+// String[] batchCode = entity.getBatchCode().split(",");
|
|
|
+// if(batchCode.length > 0){
|
|
|
+// entity.setQualifiedNumber(String.valueOf(batchCode.length));
|
|
|
+// }
|
|
|
|
|
|
if(StringUtils.isBlank(entity.getState())){
|
|
|
res.setCode("1");
|
|
@@ -500,17 +501,17 @@ public class FbsWorkingStatisticsController {
|
|
|
public Object[] saveU8(FbsWorkingStatistics entity,FbsWorkshopDispatchList workshopDispatchList,BigDecimal allHors){
|
|
|
Object[] mapR=new Object[]{};
|
|
|
if(StringUtils.isNotBlank(entity.getBatchCode())){
|
|
|
- String[] batchCodes=entity.getBatchCode().split(",");//解析逗号分隔的批号
|
|
|
List<Map<String,Object>> mapList=new ArrayList<>();
|
|
|
- for(String batchCode:batchCodes){
|
|
|
- int i=1;
|
|
|
+ //获取批号json数组
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(entity.getBatchCode());
|
|
|
+ for(int i=0;i<jsonArray.size();i++){
|
|
|
//明细
|
|
|
Map<String,Object> itemMap=new LinkedHashMap<>();
|
|
|
itemMap.put("CINVCODE",workshopDispatchList.getProductId());//成品存货编码
|
|
|
- itemMap.put("IQUANTITY",1);//数量
|
|
|
+ itemMap.put("IQUANTITY",jsonArray.getJSONObject(i).get("value"));//数量
|
|
|
itemMap.put("MOCODE",workshopDispatchList.getProductionOrderNumberName());//订单号
|
|
|
itemMap.put("MOROWMO",entity.getRowNumber());//行号
|
|
|
- itemMap.put("CBATCH",batchCode);//批号
|
|
|
+ itemMap.put("CBATCH",jsonArray.getJSONObject(i).get("key"));//批号
|
|
|
itemMap.put("cDefine27",allHors.doubleValue());//实际工时
|
|
|
Double number=Double.valueOf(entity.getQualifiedNumber());//数量
|
|
|
Double working=Double.valueOf(workshopDispatchList.getStandardWorkingHoursZ());//U8标准工时
|
|
@@ -518,8 +519,27 @@ public class FbsWorkingStatisticsController {
|
|
|
String workingTatol=df.format(number*working);
|
|
|
itemMap.put("cDefine26",workingTatol);//实际总工时
|
|
|
mapList.add(itemMap);
|
|
|
- i++;
|
|
|
}
|
|
|
+
|
|
|
+// String[] batchCodes=entity.getBatchCode().split(",");//解析逗号分隔的批号
|
|
|
+// for(String batchCode:batchCodes){
|
|
|
+// int i=1;
|
|
|
+// //明细
|
|
|
+// Map<String,Object> itemMap=new LinkedHashMap<>();
|
|
|
+// itemMap.put("CINVCODE",workshopDispatchList.getProductId());//成品存货编码
|
|
|
+// itemMap.put("IQUANTITY",1);//数量
|
|
|
+// itemMap.put("MOCODE",workshopDispatchList.getProductionOrderNumberName());//订单号
|
|
|
+// itemMap.put("MOROWMO",entity.getRowNumber());//行号
|
|
|
+// itemMap.put("CBATCH",batchCode);//批号
|
|
|
+// itemMap.put("cDefine27",allHors.doubleValue());//实际工时
|
|
|
+// Double number=Double.valueOf(entity.getQualifiedNumber());//数量
|
|
|
+// Double working=Double.valueOf(workshopDispatchList.getStandardWorkingHoursZ());//U8标准工时
|
|
|
+// DecimalFormat df = new DecimalFormat("#.00");
|
|
|
+// String workingTatol=df.format(number*working);
|
|
|
+// itemMap.put("cDefine26",workingTatol);//实际总工时
|
|
|
+// mapList.add(itemMap);
|
|
|
+// i++;
|
|
|
+// }
|
|
|
//表头
|
|
|
Map<String,Object> map=new LinkedHashMap<>();
|
|
|
map.put("CSTORENAME","100");//账套号
|