jg-waiwang-pro
vayne 5 months ago
parent 18486ab5b6
commit 96cf7363ef

@ -109,9 +109,9 @@
LEFT JOIN jg_vehicle d ON a.vehicle_id = d.id AND d.f_delete_mark IS NULL LEFT JOIN jg_vehicle d ON a.vehicle_id = d.id AND d.f_delete_mark IS NULL
LEFT JOIN flow_task e ON a.id = e.f_process_id LEFT JOIN flow_task e ON a.id = e.f_process_id
LEFT JOIN jg_product f ON c.product_id = f.id AND f.f_delete_mark IS NULL LEFT JOIN jg_product f ON c.product_id = f.id AND f.f_delete_mark IS NULL
${ew.customSqlSegment} ${ew.customSqlSegment}
AND a.id not in(select voucher_id from jg_warehousing_storage_poundlist where business_type = #{businessType} and document_type = #{documentType} and f_delete_mark is null) AND a.id not in(select voucher_id from jg_warehousing_storage_poundlist where business_type = #{businessType} and document_type = #{documentType} and f_delete_mark is null)
AND a.id not in(select voucher_id from jg_delivery_voucher_relation where document_type = #{documentType} and f_delete_mark is null) AND a.id not in(select voucher_id from jg_delivery_voucher_relation where document_type = #{documentType} and f_delete_mark is null)
</select> </select>
<select id="queryVoucherPopupByReturn" resultMap="voucherList"> <select id="queryVoucherPopupByReturn" resultMap="voucherList">
@ -190,7 +190,7 @@
LEFT JOIN flow_task e ON a.id = e.f_process_id LEFT JOIN flow_task e ON a.id = e.f_process_id
${ew.customSqlSegment} ${ew.customSqlSegment}
AND a.id not in(select voucher_id from jg_warehousing_outbound_poundlist where business_type = #{businessType} and document_type = #{documentType} and f_delete_mark is null) AND a.id not in(select voucher_id from jg_warehousing_outbound_poundlist where business_type = #{businessType} and document_type = #{documentType} and f_delete_mark is null)
AND a.id not in(select voucher_id from jg_delivery_voucher_relation where document_type = #{documentType} and f_delete_mark is null) AND a.id not in(select voucher_id from jg_delivery_voucher_relation where document_type = #{documentType} and f_delete_mark is null)
</select> </select>
@ -228,7 +228,6 @@
LEFT JOIN jg_voucher_vehicle b ON b.voucher_id = a.id AND b.f_delete_mark IS NULL LEFT JOIN jg_voucher_vehicle b ON b.voucher_id = a.id AND b.f_delete_mark IS NULL
LEFT JOIN jg_voucher_product c ON c.voucher_id = a.id AND c.f_delete_mark IS NULL LEFT JOIN jg_voucher_product c ON c.voucher_id = a.id AND c.f_delete_mark IS NULL
LEFT JOIN jg_vehicle d ON a.vehicle_id = d.id AND d.f_delete_mark IS NULL LEFT JOIN jg_vehicle d ON a.vehicle_id = d.id AND d.f_delete_mark IS NULL
LEFT JOIN flow_task e ON a.id = e.f_process_id
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
@ -406,7 +405,7 @@
AND f.f_delete_mark IS NULL AND f.f_delete_mark IS NULL
${ew.customSqlSegment} ${ew.customSqlSegment}
<if test="voucherPagination.sidx != null and voucherPagination.sidx != ''"> <if test="voucherPagination.sidx != null and voucherPagination.sidx != ''">
ORDER BY ${voucherPagination.sidx} ${voucherPagination.sort} ORDER BY ${voucherPagination.sidx} ${voucherPagination.sort}
</if> </if>
</select> </select>
@ -488,8 +487,7 @@
LEFT JOIN jg_voucher_product b ON a.id=b.voucher_id LEFT JOIN jg_voucher_product b ON a.id=b.voucher_id
LEFT JOIN jg_product c ON b.product_id=c.id LEFT JOIN jg_product c ON b.product_id=c.id
LEFT JOIN jg_vehicle d ON a.vehicle_id = d.id LEFT JOIN jg_vehicle d ON a.vehicle_id = d.id
LEFT JOIN flow_task e ON a.id = e.f_process_id ${ew.customSqlSegment} AND a.id not in (SELECT voucher_id from jg_warehousing_storage_poundlist where f_delete_mark is null)
${ew.customSqlSegment} AND a.id not in (SELECT voucher_id from jg_warehousing_storage_poundlist where f_delete_mark is null)
ORDER BY ORDER BY
a.f_creator_time DESC a.f_creator_time DESC
@ -499,12 +497,12 @@
select select
a.*, a.*,
CASE CASE
a.document_type a.document_type
WHEN '1' THEN WHEN '1' THEN
'收货凭证' '收货凭证'
WHEN '2' THEN WHEN '2' THEN
'发货凭证' '发货凭证'
END AS documentType1, END AS documentType1,
CASE CASE
a.voucher_type a.voucher_type
WHEN '1' THEN WHEN '1' THEN
@ -516,11 +514,11 @@
END AS voucherType1, END AS voucherType1,
b.vehicle_number b.vehicle_number
from jg_voucher a from jg_voucher a
left join jg_vehicle b on a.vehicle_id = b.id and b.f_delete_mark is null left join jg_vehicle b on a.vehicle_id = b.id and b.f_delete_mark is null
LEFT JOIN flow_task e ON a.id = e.f_process_id LEFT JOIN flow_task e ON a.id = e.f_process_id
where a.id = #{id} where a.id = #{id}
</select> </select>
<select id="voucherBatchChange" resultType="jnpf.entity.VoucherProductEntity"> <select id="voucherBatchChange" resultType="jnpf.entity.VoucherProductEntity">
SELECT SELECT
b.product_id AS productId, b.product_id AS productId,

@ -74,6 +74,8 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
private ProvinceService provinceService; private ProvinceService provinceService;
@Resource @Resource
private ContractLService contractLService; private ContractLService contractLService;
@Resource
private ProductWarehouseService productWarehouseService;
@Override @Override
public List<VoucherEntity> getList(VoucherPagination voucherPagination){ public List<VoucherEntity> getList(VoucherPagination voucherPagination){
@ -180,83 +182,83 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
allRuleIDlist = allRuleList; allRuleIDlist = allRuleList;
} }
} }
boolean pcPermission = true; boolean pcPermission = true;
boolean appPermission = false; boolean appPermission = false;
if(isPc && pcPermission){ if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){ if (!userProvider.get().getIsAdministrator()){
Object voucherObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherQueryWrapper,VoucherEntity.class,voucherPagination.getMenuId(),"0")); Object voucherObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherQueryWrapper,VoucherEntity.class,voucherPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(voucherObj)){ if (ObjectUtil.isEmpty(voucherObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
voucherQueryWrapper = (QueryWrapper<VoucherEntity>)voucherObj; voucherQueryWrapper = (QueryWrapper<VoucherEntity>)voucherObj;
if( voucherQueryWrapper.getExpression().getNormal().size()>0){ if( voucherQueryWrapper.getExpression().getNormal().size()>0){
voucherNum++; voucherNum++;
} }
} }
Object voucherProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherProductQueryWrapper,VoucherProductEntity.class,voucherPagination.getMenuId(),"0")); Object voucherProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherProductQueryWrapper,VoucherProductEntity.class,voucherPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(voucherProductObj)){ if (ObjectUtil.isEmpty(voucherProductObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
voucherProductQueryWrapper = (QueryWrapper<VoucherProductEntity>)voucherProductObj; voucherProductQueryWrapper = (QueryWrapper<VoucherProductEntity>)voucherProductObj;
if( voucherProductQueryWrapper.getExpression().getNormal().size()>0){ if( voucherProductQueryWrapper.getExpression().getNormal().size()>0){
voucherProductNum++; voucherProductNum++;
} }
} }
Object voucherVehicleObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherVehicleQueryWrapper,VoucherVehicleEntity.class,voucherPagination.getMenuId(),"0")); Object voucherVehicleObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherVehicleQueryWrapper,VoucherVehicleEntity.class,voucherPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(voucherVehicleObj)){ if (ObjectUtil.isEmpty(voucherVehicleObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
voucherVehicleQueryWrapper = (QueryWrapper<VoucherVehicleEntity>)voucherVehicleObj; voucherVehicleQueryWrapper = (QueryWrapper<VoucherVehicleEntity>)voucherVehicleObj;
if( voucherVehicleQueryWrapper.getExpression().getNormal().size()>0){ if( voucherVehicleQueryWrapper.getExpression().getNormal().size()>0){
voucherVehicleNum++; voucherVehicleNum++;
} }
} }
} }
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object voucherObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherQueryWrapper,VoucherEntity.class,voucherPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(voucherObj)){
return new ArrayList<>();
} else {
voucherQueryWrapper = (QueryWrapper<VoucherEntity>)voucherObj;
if( voucherQueryWrapper.getExpression().getNormal().size()>0){
voucherNum++;
}
} }
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object voucherObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherQueryWrapper,VoucherEntity.class,voucherPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(voucherObj)){
return new ArrayList<>();
} else {
voucherQueryWrapper = (QueryWrapper<VoucherEntity>)voucherObj;
if( voucherQueryWrapper.getExpression().getNormal().size()>0){
voucherNum++;
}
}
Object voucherProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherProductQueryWrapper,VoucherProductEntity.class,voucherPagination.getMenuId(),"0")); Object voucherProductObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherProductQueryWrapper,VoucherProductEntity.class,voucherPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(voucherProductObj)){ if (ObjectUtil.isEmpty(voucherProductObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
voucherProductQueryWrapper = (QueryWrapper<VoucherProductEntity>)voucherProductObj; voucherProductQueryWrapper = (QueryWrapper<VoucherProductEntity>)voucherProductObj;
if( voucherProductQueryWrapper.getExpression().getNormal().size()>0){ if( voucherProductQueryWrapper.getExpression().getNormal().size()>0){
voucherProductNum++; voucherProductNum++;
} }
} }
Object voucherVehicleObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherVehicleQueryWrapper,VoucherVehicleEntity.class,voucherPagination.getMenuId(),"0")); Object voucherVehicleObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(voucherVehicleQueryWrapper,VoucherVehicleEntity.class,voucherPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(voucherVehicleObj)){ if (ObjectUtil.isEmpty(voucherVehicleObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
voucherVehicleQueryWrapper = (QueryWrapper<VoucherVehicleEntity>)voucherVehicleObj; voucherVehicleQueryWrapper = (QueryWrapper<VoucherVehicleEntity>)voucherVehicleObj;
if( voucherVehicleQueryWrapper.getExpression().getNormal().size()>0){ if( voucherVehicleQueryWrapper.getExpression().getNormal().size()>0){
voucherVehicleNum++; voucherVehicleNum++;
} }
} }
} }
} }
if(isPc){ if(isPc){
if(ObjectUtil.isNotEmpty(voucherPagination.getVoucherCode())){ if(ObjectUtil.isNotEmpty(voucherPagination.getVoucherCode())){
voucherNum++; voucherNum++;
String value = voucherPagination.getVoucherCode() instanceof List ? String value = voucherPagination.getVoucherCode() instanceof List ?
JsonUtil.getObjectToString(voucherPagination.getVoucherCode()) : JsonUtil.getObjectToString(voucherPagination.getVoucherCode()) :
String.valueOf(voucherPagination.getVoucherCode()); String.valueOf(voucherPagination.getVoucherCode());
voucherQueryWrapper.like("a.voucher_code",value); voucherQueryWrapper.like("a.voucher_code",value);
} }
@ -282,43 +284,43 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
} }
if(ObjectUtil.isNotEmpty(voucherPagination.getVoucherType())){ if(ObjectUtil.isNotEmpty(voucherPagination.getVoucherType())){
voucherNum++; voucherNum++;
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
try { try {
String[][] voucherType = JsonUtil.getJsonToBean(voucherPagination.getVoucherType(),String[][].class); String[][] voucherType = JsonUtil.getJsonToBean(voucherPagination.getVoucherType(),String[][].class);
for(int i=0;i<voucherType.length;i++){ for(int i=0;i<voucherType.length;i++){
if(voucherType[i].length>0){ if(voucherType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(voucherType[i]))); idList.add(JsonUtil.getObjectToString(Arrays.asList(voucherType[i])));
} }
} }
}catch (Exception e1){ }catch (Exception e1){
try { try {
List<String> voucherType = JsonUtil.getJsonToList(voucherPagination.getVoucherType(),String.class); List<String> voucherType = JsonUtil.getJsonToList(voucherPagination.getVoucherType(),String.class);
if(voucherType.size()>0){ if(voucherType.size()>0){
idList.addAll(voucherType); idList.addAll(voucherType);
} }
}catch (Exception e2){ }catch (Exception e2){
idList.add(String.valueOf(voucherPagination.getVoucherType())); idList.add(String.valueOf(voucherPagination.getVoucherType()));
} }
} }
voucherQueryWrapper.and(t->{ voucherQueryWrapper.and(t->{
idList.forEach(tt->{ idList.forEach(tt->{
t.like("a.voucher_type", tt).or(); t.like("a.voucher_type", tt).or();
}); });
}); });
} }
if(ObjectUtil.isNotEmpty(voucherPagination.getPreparationTime())){ if(ObjectUtil.isNotEmpty(voucherPagination.getPreparationTime())){
voucherNum++; voucherNum++;
List PreparationTimeList = JsonUtil.getJsonToList(voucherPagination.getPreparationTime(),String.class); List PreparationTimeList = JsonUtil.getJsonToList(voucherPagination.getPreparationTime(),String.class);
Long fir = Long.valueOf(String.valueOf(PreparationTimeList.get(0))); Long fir = Long.valueOf(String.valueOf(PreparationTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(PreparationTimeList.get(1))); Long sec = Long.valueOf(String.valueOf(PreparationTimeList.get(1)));
voucherQueryWrapper.ge("a.preparation_time", new Date(fir)) voucherQueryWrapper.ge("a.preparation_time", new Date(fir))
.le("a.preparation_time", DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59")); .le("a.preparation_time", DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
} }
@ -330,11 +332,11 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
if(ObjectUtil.isNotEmpty(voucherPagination.getPoundCode())){ if(ObjectUtil.isNotEmpty(voucherPagination.getPoundCode())){
voucherNum++; voucherNum++;
String value = voucherPagination.getPoundCode() instanceof List ? String value = voucherPagination.getPoundCode() instanceof List ?
JsonUtil.getObjectToString(voucherPagination.getPoundCode()) : JsonUtil.getObjectToString(voucherPagination.getPoundCode()) :
String.valueOf(voucherPagination.getPoundCode()); String.valueOf(voucherPagination.getPoundCode());
voucherQueryWrapper.like("a.pound_code",value); voucherQueryWrapper.like("a.pound_code",value);
} }
@ -360,24 +362,24 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
} }
if(voucherProductNum>0){ if(voucherProductNum>0){
List<String> voucherProductIdList = voucherProductService.list(voucherProductQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getVoucherId())).map(t->t.getVoucherId()).collect(Collectors.toList()); List<String> voucherProductIdList = voucherProductService.list(voucherProductQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getVoucherId())).map(t->t.getVoucherId()).collect(Collectors.toList());
long count = voucherProductService.count(); long count = voucherProductService.count();
if (count>0){ if (count>0){
intersectionList.add(voucherProductIdList); intersectionList.add(voucherProductIdList);
} }
AllIdList.addAll(voucherProductIdList); AllIdList.addAll(voucherProductIdList);
} }
total+=voucherProductNum; total+=voucherProductNum;
if(voucherVehicleNum>0){ if(voucherVehicleNum>0){
List<String> voucherVehicleIdList = voucherVehicleService.list(voucherVehicleQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getVoucherId())).map(t->t.getVoucherId()).collect(Collectors.toList()); List<String> voucherVehicleIdList = voucherVehicleService.list(voucherVehicleQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getVoucherId())).map(t->t.getVoucherId()).collect(Collectors.toList());
long count = voucherVehicleService.count(); long count = voucherVehicleService.count();
if (count>0){ if (count>0){
intersectionList.add(voucherVehicleIdList); intersectionList.add(voucherVehicleIdList);
} }
AllIdList.addAll(voucherVehicleIdList); AllIdList.addAll(voucherVehicleIdList);
} }
total+=voucherVehicleNum; total+=voucherVehicleNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList); List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){ if (total>0){
if (intersection.size()==0){ if (intersection.size()==0){
@ -385,7 +387,7 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
} }
voucherQueryWrapper.in("a.id", intersection); voucherQueryWrapper.in("a.id", intersection);
} }
//是否有高级查询 //是否有高级查询
if (StringUtil.isNotEmpty(superOp)){ if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){ if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList"); allSuperIDlist.add("jnpfNullList");
@ -393,7 +395,7 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
List<String> finalAllSuperIDlist = allSuperIDlist; List<String> finalAllSuperIDlist = allSuperIDlist;
voucherQueryWrapper.and(t->t.in("a.id", finalAllSuperIDlist)); voucherQueryWrapper.and(t->t.in("a.id", finalAllSuperIDlist));
} }
//是否有数据过滤查询 //是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){ if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){ if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList"); allRuleIDlist.add("jnpfNullList");
@ -459,7 +461,7 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
@Override @Override
public List<VoucherProductEntity> getVoucherProductList(String id,VoucherPagination voucherPagination){ public List<VoucherProductEntity> getVoucherProductList(String id,VoucherPagination voucherPagination){
Map<String, Object> newtabMap=VoucherConstant.TABLEFIELDKEY.entrySet() Map<String, Object> newtabMap=VoucherConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey())); .stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="voucherProduct"; String tableName="voucherProduct";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString(); tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<VoucherProductEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<VoucherProductEntity> queryWrapper = new QueryWrapper<>();
@ -480,7 +482,7 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
@Override @Override
public List<VoucherVehicleEntity> getVoucherVehicleList(String id,VoucherPagination voucherPagination){ public List<VoucherVehicleEntity> getVoucherVehicleList(String id,VoucherPagination voucherPagination){
Map<String, Object> newtabMap=VoucherConstant.TABLEFIELDKEY.entrySet() Map<String, Object> newtabMap=VoucherConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey())); .stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="voucherVehicle"; String tableName="voucherVehicle";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString(); tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<VoucherVehicleEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<VoucherVehicleEntity> queryWrapper = new QueryWrapper<>();
@ -510,26 +512,26 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
// if(StringUtil.isEmpty(form.getPoundCode())){ // if(StringUtil.isEmpty(form.getPoundCode())){
// return "磅单编号不能为空"; // return "磅单编号不能为空";
// } // }
if(StringUtil.isEmpty(form.getVehicleId())){ if(StringUtil.isEmpty(form.getVehicleId())){
return "车牌号不能为空"; return "车牌号不能为空";
} }
if(StringUtil.isEmpty(form.getSupplierId())){ if(StringUtil.isEmpty(form.getSupplierId())){
return "发货单位不能为空"; return "发货单位不能为空";
} }
if(StringUtil.isEmpty(form.getCustomerId())){ if(StringUtil.isEmpty(form.getCustomerId())){
return "收货单位不能为空"; return "收货单位不能为空";
} }
// if(StringUtil.isEmpty(form.getCarrier())){ // if(StringUtil.isEmpty(form.getCarrier())){
// return "承运商不能为空"; // return "承运商不能为空";
// } // }
if(StringUtil.isEmpty(form.getFreight())){ if(StringUtil.isEmpty(form.getFreight())){
return "运费不能为空"; return "运费不能为空";
} }
//子表字段验证 //子表字段验证
if (form.getVoucherProductList()!=null){ if (form.getVoucherProductList()!=null){
} }
if (form.getVoucherVehicleList()!=null){ if (form.getVoucherVehicleList()!=null){
} }
return countRecover; return countRecover;
} }
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@ -562,18 +564,18 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
return countRecover; return countRecover;
} }
/** /**
* () * ()
* @param id * @param id
* @param voucherForm * @param voucherForm
* @return * @return
*/ */
@Override @Override
@Transactional @Transactional
public void saveOrUpdate(VoucherForm voucherForm,String id, boolean isSave) throws Exception{ public void saveOrUpdate(VoucherForm voucherForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
voucherForm = JsonUtil.getJsonToBean( voucherForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(VoucherConstant.getFormData(),voucherForm),VoucherForm.class); generaterSwapUtil.swapDatetime(VoucherConstant.getFormData(),voucherForm),VoucherForm.class);
VoucherEntity entity = JsonUtil.getJsonToBean(voucherForm, VoucherEntity.class); VoucherEntity entity = JsonUtil.getJsonToBean(voucherForm, VoucherEntity.class);
if(isSave){ if(isSave){
@ -799,7 +801,7 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
queryWrapper.notIn(ObjectUtils.isNotEmpty(voucherPagination.getExcludeIdList()),"a.id",voucherPagination.getExcludeIdList()); queryWrapper.notIn(ObjectUtils.isNotEmpty(voucherPagination.getExcludeIdList()),"a.id",voucherPagination.getExcludeIdList());
queryWrapper.in(ObjectUtils.isNotEmpty(voucherPagination.getProductIdList()),"c.product_id",voucherPagination.getProductIdList()); queryWrapper.in(ObjectUtils.isNotEmpty(voucherPagination.getProductIdList()),"c.product_id",voucherPagination.getProductIdList());
queryWrapper.isNull("a.f_delete_mark"); queryWrapper.isNull("a.f_delete_mark");
// queryWrapper.inSql("a.id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'");//通过审核的订单 // queryWrapper.inSql("a.id", "SELECT f_process_id FROM flow_task WHERE f_status = '2'");//通过审核的凭证
queryWrapper.like("a.organize_json_id",organize); queryWrapper.like("a.organize_json_id",organize);
Page<VoucherEntity> page=new Page<>(voucherPagination.getCurrentPage(), voucherPagination.getPageSize()); Page<VoucherEntity> page=new Page<>(voucherPagination.getCurrentPage(), voucherPagination.getPageSize());
IPage<VoucherEntity> voucherEntityIPage = voucherMapper.queryVoucherPopup1(page,queryWrapper); IPage<VoucherEntity> voucherEntityIPage = voucherMapper.queryVoucherPopup1(page,queryWrapper);
@ -987,8 +989,27 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
String[] placeDispatchArr = placeDispatch.split("/"); String[] placeDispatchArr = placeDispatch.split("/");
if(placeDispatchArr.length == 3){ if(placeDispatchArr.length == 3){
ProvinceEntity provinceEntity0 = provinceService.getInfo(placeDispatchArr[0], new ArrayList<>()); ProvinceEntity provinceEntity0 = provinceService.getInfo(placeDispatchArr[0], new ArrayList<>());
ProvinceEntity provinceEntity1 = provinceService.getInfo(placeDispatchArr[1], new ArrayList<>()); if(provinceEntity0 == null){
ProvinceEntity provinceEntity2 = provinceService.getInfo(placeDispatchArr[2], new ArrayList<>()); num ++;
failResult.add(BeanUtil.beanToMap(model));
continue;
}
List<String> parentIdList = new ArrayList<>();
parentIdList.add(provinceEntity0.getId());
ProvinceEntity provinceEntity1 = provinceService.getInfo(placeDispatchArr[1], parentIdList);
if(provinceEntity1 == null){
num ++;
failResult.add(BeanUtil.beanToMap(model));
continue;
}
parentIdList = new ArrayList<>();
parentIdList.add(provinceEntity1.getId());
ProvinceEntity provinceEntity2 = provinceService.getInfo(placeDispatchArr[2], parentIdList);
if(provinceEntity2 == null){
num ++;
failResult.add(BeanUtil.beanToMap(model));
continue;
}
if(provinceEntity0 != null && provinceEntity1 != null && provinceEntity2 != null){ if(provinceEntity0 != null && provinceEntity1 != null && provinceEntity2 != null){
List<String> placeDispatchList = new ArrayList<>(); List<String> placeDispatchList = new ArrayList<>();
placeDispatchList.add(provinceEntity0.getId()); placeDispatchList.add(provinceEntity0.getId());
@ -1015,8 +1036,27 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
String[] destinationArr = destination.split("/"); String[] destinationArr = destination.split("/");
if(destinationArr.length == 3){ if(destinationArr.length == 3){
ProvinceEntity provinceEntity0 = provinceService.getInfo(destinationArr[0], new ArrayList<>()); ProvinceEntity provinceEntity0 = provinceService.getInfo(destinationArr[0], new ArrayList<>());
ProvinceEntity provinceEntity1 = provinceService.getInfo(destinationArr[1], new ArrayList<>()); if(provinceEntity0 == null){
ProvinceEntity provinceEntity2 = provinceService.getInfo(destinationArr[2], new ArrayList<>()); num ++;
failResult.add(BeanUtil.beanToMap(model));
continue;
}
List<String> parentIdList = new ArrayList<>();
parentIdList.add(provinceEntity0.getId());
ProvinceEntity provinceEntity1 = provinceService.getInfo(destinationArr[1], parentIdList);
if(provinceEntity1 == null){
num ++;
failResult.add(BeanUtil.beanToMap(model));
continue;
}
parentIdList = new ArrayList<>();
parentIdList.add(provinceEntity1.getId());
ProvinceEntity provinceEntity2 = provinceService.getInfo(destinationArr[2], parentIdList);
if(provinceEntity2 == null){
num ++;
failResult.add(BeanUtil.beanToMap(model));
continue;
}
if(provinceEntity0 != null && provinceEntity1 != null && provinceEntity2 != null){ if(provinceEntity0 != null && provinceEntity1 != null && provinceEntity2 != null){
List<String> destinationList = new ArrayList<>(); List<String> destinationList = new ArrayList<>();
destinationList.add(provinceEntity0.getId()); destinationList.add(provinceEntity0.getId());
@ -1045,15 +1085,18 @@ public class VoucherServiceImpl extends ServiceImpl<VoucherMapper, VoucherEntity
voucherEntity.setWeighPictures1(model.getVehiclePictures8()); voucherEntity.setWeighPictures1(model.getVehiclePictures8());
voucherEntity.setWeighPictures2(model.getVehiclePictures9()); voucherEntity.setWeighPictures2(model.getVehiclePictures9());
voucherEntity.setWeighPictures3(model.getVehiclePictures10()); voucherEntity.setWeighPictures3(model.getVehiclePictures10());
/* `customer_id` varchar(50) DEFAULT NULL COMMENT 'id',
`customer_name` varchar(20) DEFAULT NULL COMMENT '',*/
this.save(voucherEntity); this.save(voucherEntity);
//子表信息 //子表信息
VoucherProductEntity voucherProductEntity = new VoucherProductEntity(); VoucherProductEntity voucherProductEntity = new VoucherProductEntity();
voucherProductEntity.setVoucherId(voucherEntity.getId()); voucherProductEntity.setVoucherId(voucherEntity.getId());
voucherProductEntity.setProductId(model.getProductName());//商品转换name转id voucherProductEntity.setProductId(model.getProductId());//商品转换name转id
voucherProductEntity.setUnit(model.getUnit());//商品转换name转id if(StringUtil.isNotEmpty(model.getProductId())){
voucherProductEntity.setSpec("");//取商品规格 ProductWarehouseEntity productWarehouseEntity = productWarehouseService.getById(model.getProductId());
if(productWarehouseEntity != null){
voucherProductEntity.setSpec(productWarehouseEntity.getSpec());//取商品规格
}
}
voucherProductEntity.setUnit(model.getUnit());
voucherProductEntity.setGrossWeight(new BigDecimal(model.getGrossWeight())); voucherProductEntity.setGrossWeight(new BigDecimal(model.getGrossWeight()));
voucherProductEntity.setTareWeight(new BigDecimal(model.getTareWeight())); voucherProductEntity.setTareWeight(new BigDecimal(model.getTareWeight()));
voucherProductEntity.setBuckleWeight(new BigDecimal(model.getBuckleWeight())); voucherProductEntity.setBuckleWeight(new BigDecimal(model.getBuckleWeight()));

@ -147,11 +147,11 @@ public class VoucherController {
private ContractLService contractLService; private ContractLService contractLService;
/** /**
* *
* *
* @param voucherPagination * @param voucherPagination
* @return * @return
*/ */
@Operation(summary = "获取列表") @Operation(summary = "获取列表")
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody VoucherPagination voucherPagination)throws IOException{ public ActionResult list(@RequestBody VoucherPagination voucherPagination)throws IOException{
@ -167,13 +167,13 @@ public class VoucherController {
entity.setPlaceDispatch(placeDispatchs.stream().collect(Collectors.joining(","))); entity.setPlaceDispatch(placeDispatchs.stream().collect(Collectors.joining(",")));
entity.setDestination(destinations.stream().collect(Collectors.joining(","))); entity.setDestination(destinations.stream().collect(Collectors.joining(",")));
Map<String, Object> voucherMap=JsonUtil.entityToMap(entity); Map<String, Object> voucherMap=JsonUtil.entityToMap(entity);
voucherMap.put("id", voucherMap.get("id")); voucherMap.put("id", voucherMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<VoucherProductEntity> voucherProductList = voucherService.getVoucherProductList(entity.getId(),voucherPagination); List<VoucherProductEntity> voucherProductList = voucherService.getVoucherProductList(entity.getId(),voucherPagination);
voucherMap.put("voucherProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(voucherProductList))); voucherMap.put("voucherProductList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(voucherProductList)));
List<VoucherVehicleEntity> voucherVehicleList = voucherService.getVoucherVehicleList(entity.getId(),voucherPagination); List<VoucherVehicleEntity> voucherVehicleList = voucherService.getVoucherVehicleList(entity.getId(),voucherPagination);
voucherMap.put("voucherVehicleList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(voucherVehicleList))); voucherMap.put("voucherVehicleList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(voucherVehicleList)));
realList.add(voucherMap); realList.add(voucherMap);
} }
//数据转换 //数据转换
@ -207,11 +207,11 @@ public class VoucherController {
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
* *
* @param voucherForm * @param voucherForm
* @return * @return
*/ */
@PostMapping() @PostMapping()
@Operation(summary = "创建") @Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid VoucherForm voucherForm) { public ActionResult create(@RequestBody @Valid VoucherForm voucherForm) {
@ -220,7 +220,7 @@ public class VoucherController {
return ActionResult.fail(b ); return ActionResult.fail(b );
} }
if (StringUtils.isNotEmpty(voucherForm.getBusinessType()) && voucherForm.getBusinessType().equals("1") && if (StringUtils.isNotEmpty(voucherForm.getBusinessType()) && voucherForm.getBusinessType().equals("1") &&
StringUtils.isNotEmpty(voucherForm.getDocumentType()) && voucherForm.getDocumentType().equals("1")) { StringUtils.isNotEmpty(voucherForm.getDocumentType()) && voucherForm.getDocumentType().equals("1")) {
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId()); OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList()); List<String> organizeJsonId = Arrays.stream(organizeEntity.getCompanyIdTree().split(",")).collect(Collectors.toList());
@ -245,10 +245,10 @@ public class VoucherController {
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
} }
/** /**
* Excel * Excel
* *
* @return * @return
*/ */
@Operation(summary = "导出Excel") @Operation(summary = "导出Excel")
@PostMapping("/Actions/Export") @PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody VoucherPagination voucherPagination) throws IOException { public ActionResult Export(@RequestBody VoucherPagination voucherPagination) throws IOException {
@ -258,27 +258,27 @@ public class VoucherController {
List<VoucherEntity> list= voucherService.getList(voucherPagination); List<VoucherEntity> list= voucherService.getList(voucherPagination);
List<Map<String, Object>> realList=new ArrayList<>(); List<Map<String, Object>> realList=new ArrayList<>();
for (VoucherEntity entity : list) { for (VoucherEntity entity : list) {
Map<String, Object> voucherMap=JsonUtil.entityToMap(entity); Map<String, Object> voucherMap=JsonUtil.entityToMap(entity);
voucherMap.put("id", voucherMap.get("id")); voucherMap.put("id", voucherMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<VoucherProductEntity> voucherProductList = voucherService.getVoucherProductList(entity.getId(),voucherPagination); List<VoucherProductEntity> voucherProductList = voucherService.getVoucherProductList(entity.getId(),voucherPagination);
voucherMap.put("tableField111",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(voucherProductList))); voucherMap.put("tableField111",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(voucherProductList)));
List<VoucherVehicleEntity> voucherVehicleList = voucherService.getVoucherVehicleList(entity.getId(),voucherPagination); List<VoucherVehicleEntity> voucherVehicleList = voucherService.getVoucherVehicleList(entity.getId(),voucherPagination);
voucherMap.put("tableField140",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(voucherVehicleList))); voucherMap.put("tableField140",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(voucherVehicleList)));
realList.add(voucherMap); realList.add(voucherMap);
} }
//数据转换 //数据转换
realList = generaterSwapUtil.swapDataList(realList, VoucherConstant.getFormData(), VoucherConstant.getColumnData(), voucherPagination.getModuleId(),false); realList = generaterSwapUtil.swapDataList(realList, VoucherConstant.getFormData(), VoucherConstant.getColumnData(), voucherPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(voucherPagination.getSelectKey())?voucherPagination.getSelectKey():new String[0]; String[]keys=!StringUtil.isEmpty(voucherPagination.getSelectKey())?voucherPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo); DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
*/ */
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){ public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build(); DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>(); List<ExcelExportEntity> entitys=new ArrayList<>();
@ -290,130 +290,130 @@ public class VoucherController {
for(String key:keys){ for(String key:keys){
switch(key){ switch(key){
case "voucherCode" : case "voucherCode" :
entitys.add(new ExcelExportEntity("凭证编号" ,"voucherCode")); entitys.add(new ExcelExportEntity("凭证编号" ,"voucherCode"));
break; break;
case "voucherType" : case "voucherType" :
entitys.add(new ExcelExportEntity("凭证类型" ,"voucherType")); entitys.add(new ExcelExportEntity("凭证类型" ,"voucherType"));
break; break;
case "preparationTime" : case "preparationTime" :
entitys.add(new ExcelExportEntity("制单时间" ,"preparationTime")); entitys.add(new ExcelExportEntity("制单时间" ,"preparationTime"));
break; break;
case "associateThirdSuppliers" : case "associateThirdSuppliers" :
entitys.add(new ExcelExportEntity("三级供应商" ,"associateThirdSuppliers")); entitys.add(new ExcelExportEntity("三级供应商" ,"associateThirdSuppliers"));
break; break;
case "voucherPictures" : case "voucherPictures" :
entitys.add(new ExcelExportEntity("凭证图片" ,"voucherPictures")); entitys.add(new ExcelExportEntity("凭证图片" ,"voucherPictures"));
break; break;
case "poundCode" : case "poundCode" :
entitys.add(new ExcelExportEntity("磅单编号" ,"poundCode")); entitys.add(new ExcelExportEntity("磅单编号" ,"poundCode"));
break; break;
case "vehicleName" : case "vehicleName" :
entitys.add(new ExcelExportEntity("车牌号" ,"vehicleName")); entitys.add(new ExcelExportEntity("车牌号" ,"vehicleName"));
break; break;
case "supplierName" : case "supplierName" :
entitys.add(new ExcelExportEntity("发货单位" ,"supplierName")); entitys.add(new ExcelExportEntity("发货单位" ,"supplierName"));
break; break;
case "customerName" : case "customerName" :
entitys.add(new ExcelExportEntity("收货单位" ,"customerName")); entitys.add(new ExcelExportEntity("收货单位" ,"customerName"));
break; break;
case "modeTransport" : case "modeTransport" :
entitys.add(new ExcelExportEntity("运输方式" ,"modeTransport")); entitys.add(new ExcelExportEntity("运输方式" ,"modeTransport"));
break; break;
case "transportationMethod" : case "transportationMethod" :
entitys.add(new ExcelExportEntity("承运方式" ,"transportationMethod")); entitys.add(new ExcelExportEntity("承运方式" ,"transportationMethod"));
break; break;
case "carrier" : case "carrier" :
entitys.add(new ExcelExportEntity("承运商" ,"carrier")); entitys.add(new ExcelExportEntity("承运商" ,"carrier"));
break; break;
case "placeDispatch" : case "placeDispatch" :
entitys.add(new ExcelExportEntity("起运地" ,"placeDispatch")); entitys.add(new ExcelExportEntity("起运地" ,"placeDispatch"));
break; break;
case "destination" : case "destination" :
entitys.add(new ExcelExportEntity("到达地" ,"destination")); entitys.add(new ExcelExportEntity("到达地" ,"destination"));
break; break;
case "freight" : case "freight" :
entitys.add(new ExcelExportEntity("运费" ,"freight")); entitys.add(new ExcelExportEntity("运费" ,"freight"));
break; break;
case "vehiclePictures" : case "vehiclePictures" :
entitys.add(new ExcelExportEntity("车辆信息" ,"vehiclePictures")); entitys.add(new ExcelExportEntity("车辆信息" ,"vehiclePictures"));
break; break;
case "vehiclePictures1" : case "vehiclePictures1" :
entitys.add(new ExcelExportEntity("车辆45度图片" ,"vehiclePictures1")); entitys.add(new ExcelExportEntity("车辆45度图片" ,"vehiclePictures1"));
break; break;
case "vehiclePictures2" : case "vehiclePictures2" :
entitys.add(new ExcelExportEntity("车辆货物图片" ,"vehiclePictures2")); entitys.add(new ExcelExportEntity("车辆货物图片" ,"vehiclePictures2"));
break; break;
case "driverPictures" : case "driverPictures" :
entitys.add(new ExcelExportEntity("驾驶员信息" ,"driverPictures")); entitys.add(new ExcelExportEntity("驾驶员信息" ,"driverPictures"));
break; break;
case "driverPictures1" : case "driverPictures1" :
entitys.add(new ExcelExportEntity("驾驶员信息行驶证图片" ,"driverPictures1")); entitys.add(new ExcelExportEntity("驾驶员信息行驶证图片" ,"driverPictures1"));
break; break;
case "driverPictures2" : case "driverPictures2" :
entitys.add(new ExcelExportEntity("驾驶员信息身份证图片" ,"driverPictures2")); entitys.add(new ExcelExportEntity("驾驶员信息身份证图片" ,"driverPictures2"));
break; break;
case "weighPictures" : case "weighPictures" :
entitys.add(new ExcelExportEntity("过磅信息正面图片" ,"weighPictures")); entitys.add(new ExcelExportEntity("过磅信息正面图片" ,"weighPictures"));
break; break;
case "weighPictures1" : case "weighPictures1" :
entitys.add(new ExcelExportEntity("过磅信息后面图片" ,"weighPictures1")); entitys.add(new ExcelExportEntity("过磅信息后面图片" ,"weighPictures1"));
break; break;
case "weighPictures2" : case "weighPictures2" :
entitys.add(new ExcelExportEntity("过磅信息过磅图片" ,"weighPictures2")); entitys.add(new ExcelExportEntity("过磅信息过磅图片" ,"weighPictures2"));
break; break;
case "weighPictures3" : case "weighPictures3" :
entitys.add(new ExcelExportEntity("过磅信息货物图片" ,"weighPictures3")); entitys.add(new ExcelExportEntity("过磅信息货物图片" ,"weighPictures3"));
break; break;
case "voucherStatus" : case "voucherStatus" :
entitys.add(new ExcelExportEntity("凭证状态" ,"voucherStatus")); entitys.add(new ExcelExportEntity("凭证状态" ,"voucherStatus"));
break; break;
case "documentType" : case "documentType" :
entitys.add(new ExcelExportEntity("单据类型" ,"documentType")); entitys.add(new ExcelExportEntity("单据类型" ,"documentType"));
break; break;
case "associatedDocumentNo" : case "associatedDocumentNo" :
entitys.add(new ExcelExportEntity("关联单据号" ,"associatedDocumentNo")); entitys.add(new ExcelExportEntity("关联单据号" ,"associatedDocumentNo"));
break; break;
case "tableField111-productId": case "tableField111-productId":
tableField111List.add(new ExcelExportEntity("商品名称" ,"productId")); tableField111List.add(new ExcelExportEntity("商品名称" ,"productId"));
break; break;
case "tableField111-spec": case "tableField111-spec":
tableField111List.add(new ExcelExportEntity("规格" ,"spec")); tableField111List.add(new ExcelExportEntity("规格" ,"spec"));
break; break;
case "tableField111-unit": case "tableField111-unit":
tableField111List.add(new ExcelExportEntity("单位" ,"unit")); tableField111List.add(new ExcelExportEntity("单位" ,"unit"));
break; break;
case "tableField111-grossWeight": case "tableField111-grossWeight":
tableField111List.add(new ExcelExportEntity("毛重" ,"grossWeight")); tableField111List.add(new ExcelExportEntity("毛重" ,"grossWeight"));
break; break;
case "tableField111-tareWeight": case "tableField111-tareWeight":
tableField111List.add(new ExcelExportEntity("皮重" ,"tareWeight")); tableField111List.add(new ExcelExportEntity("皮重" ,"tareWeight"));
break; break;
case "tableField111-buckleWeight": case "tableField111-buckleWeight":
tableField111List.add(new ExcelExportEntity("扣重" ,"buckleWeight")); tableField111List.add(new ExcelExportEntity("扣重" ,"buckleWeight"));
break; break;
case "tableField111-netWeight": case "tableField111-netWeight":
tableField111List.add(new ExcelExportEntity("净重" ,"netWeight")); tableField111List.add(new ExcelExportEntity("净重" ,"netWeight"));
break; break;
case "tableField111-remark": case "tableField111-remark":
tableField111List.add(new ExcelExportEntity("备注" ,"remark")); tableField111List.add(new ExcelExportEntity("备注" ,"remark"));
break; break;
case "tableField111-printTime": case "tableField111-printTime":
tableField111List.add(new ExcelExportEntity("打印时间" ,"printTime")); tableField111List.add(new ExcelExportEntity("打印时间" ,"printTime"));
break; break;
case "tableField140-vehicleId": case "tableField140-vehicleId":
tableField140List.add(new ExcelExportEntity("车牌号" ,"vehicleId")); tableField140List.add(new ExcelExportEntity("车牌号" ,"vehicleId"));
break; break;
case "tableField140-driverName": case "tableField140-driverName":
tableField140List.add(new ExcelExportEntity("驾驶员名称" ,"driverName")); tableField140List.add(new ExcelExportEntity("驾驶员名称" ,"driverName"));
break; break;
case "tableField140-telephone": case "tableField140-telephone":
tableField140List.add(new ExcelExportEntity("联系电话" ,"telephone")); tableField140List.add(new ExcelExportEntity("联系电话" ,"telephone"));
break; break;
case "tableField140-carrier": case "tableField140-carrier":
tableField140List.add(new ExcelExportEntity("承运商" ,"carrier")); tableField140List.add(new ExcelExportEntity("承运商" ,"carrier"));
break; break;
default: default:
break; break;
} }
} }
if(tableField111List.size() > 0){ if(tableField111List.size() > 0){
@ -486,53 +486,53 @@ public class VoucherController {
return vo; return vo;
} }
/** /**
* *
* @param ids * @param ids
* @return * @return
*/ */
@DeleteMapping("/batchRemove") @DeleteMapping("/batchRemove")
@Transactional @Transactional
@Operation(summary = "批量删除") @Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody String ids){ public ActionResult batchRemove(@RequestBody String ids){
List<String> idList = JsonUtil.getJsonToList(ids, String.class); List<String> idList = JsonUtil.getJsonToList(ids, String.class);
List<String> columnIdList = new ArrayList<>(20); List<String> columnIdList = new ArrayList<>(20);
int i =0; int i =0;
String errInfo = ""; String errInfo = "";
for (String allId : idList){ for (String allId : idList){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(allId, FlowTaskEntity::getId, FlowTaskEntity::getStatus); FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(allId, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity==null){ if (taskEntity==null){
columnIdList.add(allId);
this.delete(allId);
}else if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)){
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
columnIdList.add(allId); columnIdList.add(allId);
this.delete(allId); this.delete(allId);
}else if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)){ i++;
try { } catch (WorkFlowException e) {
generaterSwapUtil.deleteFlowTask(taskEntity); errInfo = e.getMessage();
columnIdList.add(allId); e.printStackTrace();
this.delete(allId);
i++;
} catch (WorkFlowException e) {
errInfo = e.getMessage();
e.printStackTrace();
}
} }
} }
if (i == 0 && columnIdList.size()==0){ }
return ActionResult.fail("流程已发起,无法删除"); if (i == 0 && columnIdList.size()==0){
} return ActionResult.fail("流程已发起,无法删除");
if (StringUtil.isNotEmpty(errInfo)){ }
return ActionResult.fail(errInfo); if (StringUtil.isNotEmpty(errInfo)){
} return ActionResult.fail(errInfo);
return ActionResult.success("删除成功"); }
return ActionResult.success("删除成功");
} }
/** /**
* *
* @param id * @param id
* @param voucherForm * @param voucherForm
* @return * @return
*/ */
@PutMapping("/{id}") @PutMapping("/{id}")
@Operation(summary = "更新") @Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid VoucherForm voucherForm, public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid VoucherForm voucherForm,
@RequestParam(value = "isImport", required = false) boolean isImport){ @RequestParam(value = "isImport", required = false) boolean isImport){
voucherForm.setId(id); voucherForm.setId(id);
if (!isImport) { if (!isImport) {
String b = voucherService.checkForm(voucherForm,1); String b = voucherService.checkForm(voucherForm,1);
@ -568,10 +568,10 @@ public class VoucherController {
} }
} }
/** /**
* *
* @param id * @param id
* @return * @return
*/ */
@Operation(summary = "删除") @Operation(summary = "删除")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
@ -593,11 +593,11 @@ public class VoucherController {
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
/** /**
* () * ()
* 使- * 使-
* @param id * @param id
* @return * @return
*/ */
@Operation(summary = "表单信息(详情页)") @Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){ public ActionResult detailInfo(@PathVariable("id") String id){
@ -629,11 +629,11 @@ public class VoucherController {
return ActionResult.success(voucherMap); return ActionResult.success(voucherMap);
} }
/** /**
* () * ()
* 使- * 使-
* @param id * @param id
* @return * @return
*/ */
@Operation(summary = "信息") @Operation(summary = "信息")
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){ public ActionResult info(@PathVariable("id") String id){
@ -1412,91 +1412,14 @@ public class VoucherController {
@Operation(summary = "模板下载") @Operation(summary = "模板下载")
@GetMapping("/TemplateDownload") @GetMapping("/TemplateDownload")
public ActionResult<DownloadVO> TemplateDownload(){ public ActionResult<DownloadVO> TemplateDownload(){
DownloadVO vo = DownloadVO.builder().build();
UserInfo userInfo = userProvider.get();
Map<String, Object> dataMap = new HashMap<>();
//主表对象
List<ExcelExportEntity> entitys = new ArrayList<>();
//以下添加字段
entitys.add(new ExcelExportEntity("凭证编号" ,"voucherCode"));
dataMap.put("voucherCode", "系统自动生成");
entitys.add(new ExcelExportEntity("凭证类型" ,"voucherType"));
entitys.add(new ExcelExportEntity("制单时间" ,"preparationTime"));
dataMap.put("preparationTime", "例: yyyy-MM-dd");
entitys.add(new ExcelExportEntity("磅单编号" ,"poundCode"));
entitys.add(new ExcelExportEntity("车牌号" ,"vehicleName"));
entitys.add(new ExcelExportEntity("发货单位" ,"supplierName"));
entitys.add(new ExcelExportEntity("收货单位" ,"customerName"));
entitys.add(new ExcelExportEntity("运输方式" ,"modeTransport"));
entitys.add(new ExcelExportEntity("承运方式" ,"transportationMethod"));
entitys.add(new ExcelExportEntity("承运商" ,"carrier"));
entitys.add(new ExcelExportEntity("起运地" ,"placeDispatch"));
dataMap.put("placeDispatch", "例:福建省/莆田市/城厢区");
entitys.add(new ExcelExportEntity("到达地" ,"destination"));
dataMap.put("destination", "例:福建省/莆田市/城厢区");
entitys.add(new ExcelExportEntity("运费" ,"freight"));
entitys.add(new ExcelExportEntity("关联单据号" ,"associatedDocumentNo"));
entitys.add(new ExcelExportEntity("单据类型" ,"documentType"));
entitys.add(new ExcelExportEntity("凭证状态" ,"voucherStatus"));
//tableField111子表对象
ExcelExportEntity tableField111ExcelEntity = new ExcelExportEntity("","tableField111");
List<ExcelExportEntity> tableField111ExcelEntityList = new ArrayList<>();
Map<String, Object> tableField111ChildData = new HashMap<>();
List<Map<String, Object>> tableField111ChildDataList = new ArrayList<>();
tableField111ExcelEntityList.add(new ExcelExportEntity("规格" ,"spec"));
tableField111ExcelEntityList.add(new ExcelExportEntity("单位" ,"unit"));
tableField111ExcelEntityList.add(new ExcelExportEntity("毛重" ,"grossWeight"));
tableField111ExcelEntityList.add(new ExcelExportEntity("皮重" ,"tareWeight"));
tableField111ExcelEntityList.add(new ExcelExportEntity("扣重" ,"buckleWeight"));
tableField111ExcelEntityList.add(new ExcelExportEntity("净重" ,"netWeight"));
tableField111ExcelEntityList.add(new ExcelExportEntity("备注" ,"remark"));
tableField111ExcelEntityList.add(new ExcelExportEntity("打印时间" ,"printTime"));
tableField111ChildData.put("printTime", "例: yyyy-MM-dd");
tableField111ChildDataList.add(tableField111ChildData);
dataMap.put("tableField111",tableField111ChildDataList);
tableField111ExcelEntity.setList(tableField111ExcelEntityList);
entitys.add(tableField111ExcelEntity);
//tableField140子表对象
ExcelExportEntity tableField140ExcelEntity = new ExcelExportEntity("","tableField140");
List<ExcelExportEntity> tableField140ExcelEntityList = new ArrayList<>();
Map<String, Object> tableField140ChildData = new HashMap<>();
List<Map<String, Object>> tableField140ChildDataList = new ArrayList<>();
tableField140ExcelEntityList.add(new ExcelExportEntity("驾驶员名称" ,"driverName"));
tableField140ExcelEntityList.add(new ExcelExportEntity("联系电话" ,"telephone"));
tableField140ExcelEntityList.add(new ExcelExportEntity("承运商" ,"carrier"));
tableField140ChildDataList.add(tableField140ChildData);
dataMap.put("tableField140",tableField140ChildDataList);
tableField140ExcelEntity.setList(tableField140ExcelEntityList);
entitys.add(tableField140ExcelEntity);
List<Map<String, Object>> list = new ArrayList<>();
list.add(dataMap);
ExportParams exportParams = new ExportParams(null, "凭证单模板"); UserInfo userInfo = userProvider.get();
exportParams.setType(ExcelType.XSSF); DownloadVO vo = DownloadVO.builder().build();
try{ try {
@Cleanup Workbook workbook = new HSSFWorkbook(); vo.setName("凭证导入.zip");
if (entitys.size()>0){ vo.setUrl(UploaderUtil.uploaderFile("/api/file/DownloadModel?encryption=", userInfo.getId() + "#" + "凭证导入.zip" + "#" + "Temporary"));
if (list.size()==0){
list.add(new HashMap<>());
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(VoucherConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
}
String fileName = "凭证单模板" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) { } catch (Exception e) {
log.error("模板信息导出Excel错误:{}", e.getMessage()); log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
} }
return ActionResult.success(vo); return ActionResult.success(vo);
} }
@ -1509,14 +1432,14 @@ public class VoucherController {
@Operation(summary = "导入预览" ) @Operation(summary = "导入预览" )
@GetMapping("/ImportPreview") @GetMapping("/ImportPreview")
public ActionResult<Map<String, Object>> ImportPreview(String fileName) throws Exception { public ActionResult<Map<String, Object>> ImportPreview(String fileName) throws Exception {
fileName = "66441f9464a4bd991e589f74.xls"; //fileName = "6645af470365f697b7120ff7.xls";
Map<String, Object> headAndDataMap = new HashMap<>(2); Map<String, Object> headAndDataMap = new HashMap<>(2);
String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getWebAnnexFilePath(); String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getWebAnnexFilePath();
FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName); FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName);
File temporary = new File(XSSEscape.escapePath(filePath + fileName)); File temporary = new File(XSSEscape.escapePath(filePath + fileName));
int headerRowIndex = 1; int headerRowIndex = 1;
ImportParams params = new ImportParams(); ImportParams params = new ImportParams();
params.setTitleRows(0); params.setTitleRows(2);
params.setHeadRows(headerRowIndex); params.setHeadRows(headerRowIndex);
params.setNeedVerify(true); params.setNeedVerify(true);
try { try {
@ -1527,7 +1450,7 @@ public class VoucherController {
columns.add(new ExcelImFieldModel("businessType","业务类型")); columns.add(new ExcelImFieldModel("businessType","业务类型"));
columns.add(new ExcelImFieldModel("documentType","单据类型")); columns.add(new ExcelImFieldModel("documentType","单据类型"));
columns.add(new ExcelImFieldModel("voucherType","凭证类型")); columns.add(new ExcelImFieldModel("voucherType","凭证类型"));
columns.add(new ExcelImFieldModel("receivingDate","收货日期")); // columns.add(new ExcelImFieldModel("receivingDate","收货日期"));
columns.add(new ExcelImFieldModel("productName","商品名称")); columns.add(new ExcelImFieldModel("productName","商品名称"));
columns.add(new ExcelImFieldModel("vehicleName","送货车号")); columns.add(new ExcelImFieldModel("vehicleName","送货车号"));
columns.add(new ExcelImFieldModel("unit","单位")); columns.add(new ExcelImFieldModel("unit","单位"));
@ -1557,7 +1480,7 @@ public class VoucherController {
columns.add(new ExcelImFieldModel("vehiclePictures10","车辆信息10")); columns.add(new ExcelImFieldModel("vehiclePictures10","车辆信息10"));
columns.add(new ExcelImFieldModel("contractNo","合同编码")); columns.add(new ExcelImFieldModel("contractNo","合同编码"));
//tableField111子表对象 //tableField111子表对象
List<ExcelImFieldModel> tableField111columns = new ArrayList<>(); /*List<ExcelImFieldModel> tableField111columns = new ArrayList<>();
tableField111columns.add(new ExcelImFieldModel("spec" ,"规格")); tableField111columns.add(new ExcelImFieldModel("spec" ,"规格"));
tableField111columns.add(new ExcelImFieldModel("unit" ,"单位")); tableField111columns.add(new ExcelImFieldModel("unit" ,"单位"));
tableField111columns.add(new ExcelImFieldModel("grossWeight" ,"毛重")); tableField111columns.add(new ExcelImFieldModel("grossWeight" ,"毛重"));
@ -1572,7 +1495,7 @@ public class VoucherController {
tableField140columns.add(new ExcelImFieldModel("driverName" ,"驾驶员名称")); tableField140columns.add(new ExcelImFieldModel("driverName" ,"驾驶员名称"));
tableField140columns.add(new ExcelImFieldModel("telephone" ,"联系电话")); tableField140columns.add(new ExcelImFieldModel("telephone" ,"联系电话"));
tableField140columns.add(new ExcelImFieldModel("carrier" ,"承运商")); tableField140columns.add(new ExcelImFieldModel("carrier" ,"承运商"));
columns.add(new ExcelImFieldModel("tableField140","",tableField140columns)); columns.add(new ExcelImFieldModel("tableField140","",tableField140columns));*/
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList))); headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns))); headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e){ } catch (Exception e){

@ -202,7 +202,5 @@ public class VoucherEntity {
private String isReturnCargoOrder1; private String isReturnCargoOrder1;
@TableField(exist = false) @TableField(exist = false)
private List<VoucherBatchProductModel> voucherBatchProductModelList; private List<VoucherBatchProductModel> voucherBatchProductModelList;
@TableField(exist = false)
private String deliveryType1;
} }

@ -592,6 +592,7 @@ export default {
}, },
bomitemvalueExistNum() { bomitemvalueExistNum() {
debugger
let isOk = true; let isOk = true;
var num = '1'; var num = '1';
var nums = '0'; var nums = '0';

@ -511,6 +511,7 @@ export default {
data: _query data: _query
}).then(res => { }).then(res => {
var _list = res.data.list; var _list = res.data.list;
debugger
this.list = _list.map(o => ({ this.list = _list.map(o => ({
...o, ...o,
...this.expandObj, ...this.expandObj,

@ -909,6 +909,7 @@ export default {
data: id data: id
}).then(res => { }).then(res => {
const purchaseOrder = res.data const purchaseOrder = res.data
debugger
this.dataForm.purchaseOrderInfo = []; this.dataForm.purchaseOrderInfo = [];
this.dataForm.purchaseOrderInfo[0] = purchaseOrder; this.dataForm.purchaseOrderInfo[0] = purchaseOrder;
this.dataForm.businessId = purchaseOrder.id; this.dataForm.businessId = purchaseOrder.id;
@ -923,6 +924,7 @@ export default {
item.purchaseNum = item.businessNum; item.purchaseNum = item.businessNum;
item.warehousingUnitId = item.salesMainUnitId; item.warehousingUnitId = item.salesMainUnitId;
}); });
debugger
this.dataForm.warehousingProductList = purchaseOrder.businessOrderProductRelationalList; this.dataForm.warehousingProductList = purchaseOrder.businessOrderProductRelationalList;
}) })
} }

@ -1560,7 +1560,9 @@ export default {
methods: { methods: {
// 线 // 线
removeForm() { removeForm() {
debugger
if (this.dataForm.orderType == '3') { if (this.dataForm.orderType == '3') {
debugger
this.dataForm.contractId = undefined this.dataForm.contractId = undefined
} }
}, },
@ -1723,6 +1725,7 @@ export default {
} }
}, },
contractInfo(val, val2) { contractInfo(val, val2) {
debugger
this.dataForm.expectArriveDate = []; this.dataForm.expectArriveDate = [];
if (val2.contractPeriodTime && val2.contractPeriodTimeEnd) { if (val2.contractPeriodTime && val2.contractPeriodTimeEnd) {
this.dataForm.expectArriveDate[0] = new Date(val2.contractPeriodTime) this.dataForm.expectArriveDate[0] = new Date(val2.contractPeriodTime)

@ -771,6 +771,7 @@ export default {
data: id data: id
}).then(res => { }).then(res => {
const purchaseOrder = res.data const purchaseOrder = res.data
debugger
this.dataForm.returnOrderInfo = []; this.dataForm.returnOrderInfo = [];
this.dataForm.returnOrderInfo[0] = purchaseOrder; this.dataForm.returnOrderInfo[0] = purchaseOrder;
this.dataForm.businessId = purchaseOrder.id; this.dataForm.businessId = purchaseOrder.id;

@ -1802,6 +1802,7 @@ export default {
const defaultArr = this.dataForm.deliveryProductRelationList const defaultArr = this.dataForm.deliveryProductRelationList
this.dataForm.deliveryProductRelationList.splice(0, this.dataForm.deliveryProductRelationList.length, ...defaultArr) this.dataForm.deliveryProductRelationList.splice(0, this.dataForm.deliveryProductRelationList.length, ...defaultArr)
} else { } else {
debugger
this.$message({ this.$message({
type: 'error', type: 'error',
message: "采购订单未审核", message: "采购订单未审核",

@ -505,6 +505,7 @@ export default {
data: _query data: _query
}).then(res => { }).then(res => {
var _list = res.data.list; var _list = res.data.list;
debugger
this.list = _list.map(o => ({ this.list = _list.map(o => ({
...o, ...o,
...this.expandObj, ...this.expandObj,

@ -1268,6 +1268,7 @@ export default {
this.dataForm.deliveryVoucherRelationList.push(item) this.dataForm.deliveryVoucherRelationList.push(item)
let productEntity = {} let productEntity = {}
e.productWarehouseEntityList.forEach(item => { e.productWarehouseEntityList.forEach(item => {
debugger
const obj = this.productByOrderList.find(e => e.productId == item.id) || {} const obj = this.productByOrderList.find(e => e.productId == item.id) || {}
item.salesMainUnitId = obj.salesMainUnitId; item.salesMainUnitId = obj.salesMainUnitId;
item.saleNum = obj.businessNum; item.saleNum = obj.businessNum;
@ -1372,6 +1373,7 @@ export default {
const defaultArr = this.dataForm.deliveryProductRelationList const defaultArr = this.dataForm.deliveryProductRelationList
this.dataForm.deliveryProductRelationList.splice(0, this.dataForm.deliveryProductRelationList.length, ...defaultArr) this.dataForm.deliveryProductRelationList.splice(0, this.dataForm.deliveryProductRelationList.length, ...defaultArr)
} else { } else {
debugger
this.$message({ this.$message({
type: 'error', type: 'error',
message: "销售订单未审核", message: "销售订单未审核",

@ -1275,6 +1275,7 @@ export default {
this.dataForm.deliveryVoucherRelationList.push(item) this.dataForm.deliveryVoucherRelationList.push(item)
let productEntity = {} let productEntity = {}
e.warehousingOutboundProductEntityList.forEach(item => { e.warehousingOutboundProductEntityList.forEach(item => {
debugger
const obj = this.productByOrderList.find(e => e.productId == item.productId) || {} const obj = this.productByOrderList.find(e => e.productId == item.productId) || {}
item.salesMainUnitId = obj.salesMainUnitId item.salesMainUnitId = obj.salesMainUnitId
item.saleNum = obj.businessNum item.saleNum = obj.businessNum

@ -778,6 +778,7 @@ export default {
data: id data: id
}).then(res => { }).then(res => {
const saleOrder = res.data const saleOrder = res.data
debugger
this.dataForm.saleOrderInfo = []; this.dataForm.saleOrderInfo = [];
this.dataForm.saleOrderInfo[0] = saleOrder; this.dataForm.saleOrderInfo[0] = saleOrder;
this.dataForm.businessId = saleOrder.id; this.dataForm.businessId = saleOrder.id;
@ -794,6 +795,7 @@ export default {
item.warehousingUnitId = item.deliveryUnit; item.warehousingUnitId = item.deliveryUnit;
item.produceDate = item.produceTime item.produceDate = item.produceTime
}); });
debugger
this.dataForm.warehousingProductList = saleOrder.deliveryProductRelationEntityList; this.dataForm.warehousingProductList = saleOrder.deliveryProductRelationEntityList;
}) })
} }

@ -1557,6 +1557,7 @@ export default {
// notTaxCount: this.jnpf.floatMul(e.businessNum, this.jnpf.floatDiv(e.businessPrice, this.jnpf.floatAdd(1, this.jnpf.floatDiv(e.tax, 100))).toFixed(6)).toFixed(2) // // notTaxCount: this.jnpf.floatMul(e.businessNum, this.jnpf.floatDiv(e.businessPrice, this.jnpf.floatAdd(1, this.jnpf.floatDiv(e.tax, 100))).toFixed(6)).toFixed(2) //
} }
if (e.salesMainUnitIds) { if (e.salesMainUnitIds) {
debugger
var unitName = JSON.parse(e.salesMainUnitIds) var unitName = JSON.parse(e.salesMainUnitIds)
var optArray = []; var optArray = [];
for (let i = 0; i < unitName.length; i++) { for (let i = 0; i < unitName.length; i++) {
@ -1568,6 +1569,7 @@ export default {
} }
item.businessorderproductrelationalsalesMainUnitIdOptions = optArray item.businessorderproductrelationalsalesMainUnitIdOptions = optArray
} }
debugger
this.dataForm.businessOrderProductRelationalList.push(item) this.dataForm.businessOrderProductRelationalList.push(item)
} }
}, },
@ -1655,6 +1657,7 @@ export default {
}) })
}, },
contractList(list) { contractList(list) {
debugger
let e = list let e = list
this.dataForm.contractId = e.id this.dataForm.contractId = e.id
this.dataForm.contractName = e.contractName this.dataForm.contractName = e.contractName
@ -1801,6 +1804,7 @@ export default {
this.dataForm.businessOrderProductRelationalList = data[0].businessOrderProductRelationalList this.dataForm.businessOrderProductRelationalList = data[0].businessOrderProductRelationalList
} }
if (data.flag == '发货凭证生成销售订单') { if (data.flag == '发货凭证生成销售订单') {
debugger
this.productCreate = true this.productCreate = true
this.dataForm.orderType = '3' this.dataForm.orderType = '3'
this.dataForm.enterpriseId = data[0].supplierId this.dataForm.enterpriseId = data[0].supplierId
@ -1818,6 +1822,7 @@ export default {
data: voucherIdList data: voucherIdList
}).then(res => { }).then(res => {
var list = res.data; var list = res.data;
debugger
list.forEach(item => { list.forEach(item => {
this.productIds.push(item.id) this.productIds.push(item.id)
item.productId = item.id item.productId = item.id

@ -924,6 +924,7 @@ export default {
item.warehousingUnitId = item.salesMainUnitId; item.warehousingUnitId = item.salesMainUnitId;
} }
); );
debugger
this.dataForm.warehousingProductList = this.dataForm.warehousingProductList =
saleOrder.businessOrderProductRelationalList; saleOrder.businessOrderProductRelationalList;
}); });
@ -1171,6 +1172,7 @@ export default {
return _data; return _data;
}, },
dataInfo(dataAll) { dataInfo(dataAll) {
debugger
let _dataAll = dataAll; let _dataAll = dataAll;
this.dataForm = _dataAll; this.dataForm = _dataAll;
this.isEdit = true; this.isEdit = true;

@ -4,7 +4,7 @@
<div class="JNPF-common-page-header"> <div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '新建':'编辑'" /> <el-page-header @back="goBack" :content="!dataForm.id ? '新建':'编辑'" />
<div class="options"> <div class="options">
<!-- <el-dropdown class="dropdown" placement="bottom"> <el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px"> <el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i> <i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
@ -21,7 +21,7 @@
:loading="continueBtnLoading" :disabled='btnLoading'> :loading="continueBtnLoading" :disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item> {{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> --> </el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
:disabled='continueBtnLoading'> </el-button> :disabled='continueBtnLoading'> </el-button>
<el-button @click="goBack"> </el-button> <el-button @click="goBack"> </el-button>
@ -42,7 +42,7 @@
<jnpf-form-tip-item label="凭证类型" prop="voucherType"> <jnpf-form-tip-item label="凭证类型" prop="voucherType">
<JnpfSelect v-model="dataForm.voucherType" @change="changeData('voucherType',-1)" <JnpfSelect v-model="dataForm.voucherType" @change="changeData('voucherType',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' placeholder="请选择" clearable :style='{"width":"100%"}'
:options="voucherTypeOptions" :props="voucherTypeProps" disabled> :options="voucherTypeOptions" :props="voucherTypeProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -52,7 +52,7 @@
<JnpfDatePicker v-model="dataForm.preparationTime" <JnpfDatePicker v-model="dataForm.preparationTime"
@change="changeData('preparationTime',-1)" :startTime="dateTime(false,1,1,'','')" @change="changeData('preparationTime',-1)" :startTime="dateTime(false,1,1,'','')"
:endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable
:style='{"width":"100%"}' type="date" format="yyyy-MM-dd" disabled> :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -60,7 +60,7 @@
<jnpf-form-tip-item label="配送方式" prop="deliveryType"> <jnpf-form-tip-item label="配送方式" prop="deliveryType">
<JnpfSelect v-model="dataForm.deliveryType" @change="changeData('deliveryType',-1)" <JnpfSelect v-model="dataForm.deliveryType" @change="changeData('deliveryType',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' placeholder="请选择" clearable :style='{"width":"100%"}'
:options="deliveryTypeOptions" :props="deliveryTypeProps" disabled> :options="deliveryTypeOptions" :props="deliveryTypeProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -77,8 +77,7 @@
placeholder="请选择" propsValue="f_id" popupWidth="800px" popupTitle="选择数据" placeholder="请选择" propsValue="f_id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='f_full_name' field='supplierId' popupType="dialog" relationField='f_full_name' field='supplierId'
interfaceId="522729853024209157" :pageSize="20" interfaceId="522729853024209157" :pageSize="20"
:columnOptions="supplierIdcolumnOptions" clearable :style='{"width":"100%"}' :columnOptions="supplierIdcolumnOptions" clearable :style='{"width":"100%"}'>
disabled>
</JnpfPopupSelect> </JnpfPopupSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
@ -135,7 +134,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.unit" <JnpfInput v-model="scope.row.unit"
@change="changeData('voucherproduct-unit',scope.$index)" placeholder="请输入" @change="changeData('voucherproduct-unit',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}' disabled> clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -146,8 +145,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.grossWeight" <JnpfInput v-model="scope.row.grossWeight"
@change="changeData('voucherproduct-grossWeight',scope.$index)" @change="changeData('voucherproduct-grossWeight',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}' placeholder="请输入" clearable :style='{"width":"100%"}'>
@input="UpdateWeight(scope.row)">
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -158,8 +156,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.tareWeight" <JnpfInput v-model="scope.row.tareWeight"
@change="changeData('voucherproduct-tareWeight',scope.$index)" @change="changeData('voucherproduct-tareWeight',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}' placeholder="请输入" clearable :style='{"width":"100%"}'>
@input="UpdateWeight(scope.row)">
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -170,8 +167,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.buckleWeight" <JnpfInput v-model="scope.row.buckleWeight"
@change="changeData('voucherproduct-buckleWeight',scope.$index)" @change="changeData('voucherproduct-buckleWeight',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}' placeholder="请输入" clearable :style='{"width":"100%"}'>
@input="UpdateWeight(scope.row)">
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -193,7 +189,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.freight" <JnpfInput v-model="scope.row.freight"
@change="changeData('voucherproduct-remark',scope.$index)" placeholder="请输入" @change="changeData('voucherproduct-remark',scope.$index)" placeholder="请输入"
clearable :style='{"width":"100%"}' disabled> clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -210,7 +206,7 @@
relationField='vehicle_number' :field="'printTime'+scope.$index" relationField='vehicle_number' :field="'printTime'+scope.$index"
interfaceId="529920852288864453" :pageSize="20" interfaceId="529920852288864453" :pageSize="20"
:columnOptions="voucherproductprintTimecolumnOptions" clearable :columnOptions="voucherproductprintTimecolumnOptions" clearable
:style='{"width":"100%"}' disabled> :style='{"width":"100%"}'>
</JnpfPopupSelect> </JnpfPopupSelect>
</template> </template>
</el-table-column> </el-table-column>
@ -221,7 +217,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.driverName" <JnpfInput v-model="scope.row.driverName"
@change="changeData('voucherproduct-receiptUnit',scope.$index)" @change="changeData('voucherproduct-receiptUnit',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -232,7 +228,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.poundCode" <JnpfInput v-model="scope.row.poundCode"
@change="changeData('voucherproduct-tenantId',scope.$index)" @change="changeData('voucherproduct-tenantId',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -244,8 +240,7 @@
<JnpfSelect v-model="scope.row.modeTransport" <JnpfSelect v-model="scope.row.modeTransport"
@change="changeData('voucherproduct-cargoId',scope.$index)" @change="changeData('voucherproduct-cargoId',scope.$index)"
placeholder="请选择" clearable :style='{"width":"100%"}' placeholder="请选择" clearable :style='{"width":"100%"}'
:options="voucherproductcargoIdOptions" :props="voucherproductcargoIdProps" :options="voucherproductcargoIdOptions" :props="voucherproductcargoIdProps">
disabled>
</JnpfSelect> </JnpfSelect>
</template> </template>
</el-table-column> </el-table-column>
@ -258,7 +253,7 @@
@change="changeData('voucherproduct-receiptNum',scope.$index)" @change="changeData('voucherproduct-receiptNum',scope.$index)"
placeholder="请选择" clearable :style='{"width":"100%"}' placeholder="请选择" clearable :style='{"width":"100%"}'
:options="voucherproductreceiptNumOptions" :options="voucherproductreceiptNumOptions"
:props="voucherproductreceiptNumProps" disabled> :props="voucherproductreceiptNumProps">
</JnpfSelect> </JnpfSelect>
</template> </template>
</el-table-column> </el-table-column>
@ -269,7 +264,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfInput v-model="scope.row.carrier" <JnpfInput v-model="scope.row.carrier"
@change="changeData('voucherproduct-batchNo',scope.$index)" @change="changeData('voucherproduct-batchNo',scope.$index)"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled> placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput> </JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -281,7 +276,7 @@
<JnpfAreaSelect v-model="scope.row.placeDispatch" <JnpfAreaSelect v-model="scope.row.placeDispatch"
@change="changeData('voucherproduct-deliveryUnit',scope.$index)" @change="changeData('voucherproduct-deliveryUnit',scope.$index)"
placeholder="请选择" selectType="all" clearable :style='{"width":"100%"}' placeholder="请选择" selectType="all" clearable :style='{"width":"100%"}'
:level="2" disabled> :level="2">
</JnpfAreaSelect> </JnpfAreaSelect>
</template> </template>
</el-table-column> </el-table-column>
@ -293,7 +288,7 @@
<JnpfAreaSelect v-model="scope.row.destination" <JnpfAreaSelect v-model="scope.row.destination"
@change="changeData('voucherproduct-deliveryNum',scope.$index)" @change="changeData('voucherproduct-deliveryNum',scope.$index)"
placeholder="请选择" selectType="all" clearable :style='{"width":"100%"}' placeholder="请选择" selectType="all" clearable :style='{"width":"100%"}'
:level="2" disabled> :level="2">
</JnpfAreaSelect> </JnpfAreaSelect>
</template> </template>
</el-table-column> </el-table-column>
@ -395,7 +390,7 @@ export default {
currVmodel: "", currVmodel: "",
dataForm: { dataForm: {
voucherType: undefined, voucherType: undefined,
preparationTime: new Date(), preparationTime: undefined,
deliveryType: undefined, deliveryType: undefined,
supplierId: undefined, supplierId: undefined,
customerId: undefined, customerId: undefined,
@ -473,7 +468,7 @@ export default {
documentType: [], documentType: [],
voucherStatus: [], voucherStatus: [],
businessType: [], businessType: [],
voucherproductproductId: [{ "fieldName": "", "field": "subjectId", "defaultValue": "", "jnpfKey": "popupSelect", "dataType": "varchar", "id": "spNokw1", "relationField": "supplierId", "required": "0" }], voucherproductproductId: [],
voucherproductspec: [], voucherproductspec: [],
voucherproductunit: [], voucherproductunit: [],
voucherproductgrossWeight: [], voucherproductgrossWeight: [],
@ -509,6 +504,7 @@ export default {
}, },
// //
initVoucherData(selectData) { initVoucherData(selectData) {
debugger
const data = selectData const data = selectData
if (!data) { if (!data) {
return return
@ -520,11 +516,13 @@ export default {
data.forEach(item => { data.forEach(item => {
voucherIds.voucherIdList.push(item.id) voucherIds.voucherIdList.push(item.id)
}); });
debugger
request({ request({
url: `/api/scm/Voucher/batch`, url: `/api/scm/Voucher/batch`,
method: 'post', method: 'post',
data: voucherIds data: voucherIds
}).then(res => { }).then(res => {
debugger
var voucherInfo = res.data; var voucherInfo = res.data;
voucherInfo.businessType = '2' voucherInfo.businessType = '2'
voucherInfo.documentType = '2' voucherInfo.documentType = '2'
@ -537,8 +535,6 @@ export default {
this.dataForm.voucherProductBatchList = voucherInfo.voucherProductList this.dataForm.voucherProductBatchList = voucherInfo.voucherProductList
this.dataForm.isSaleDeliveryVoucherSource = voucherInfo.id this.dataForm.isSaleDeliveryVoucherSource = voucherInfo.id
this.dataForm.supplierId = voucherInfo.customerId this.dataForm.supplierId = voucherInfo.customerId
this.dataForm.customerId = ''
this.dataForm.preparationTime = new Date()
}) })
}, },
prev() { prev() {
@ -576,8 +572,10 @@ export default {
}); });
}, },
goBack() { goBack() {
debugger
this.visible = false this.visible = false
this.$emit('refresh', true) this.$router.go(-1)
// this.$emit('refreshDataList', true)
}, },
changeData(model, index) { changeData(model, index) {
this.isEdit = false this.isEdit = false
@ -680,6 +678,9 @@ export default {
} }
return isOk; return isOk;
}, },
// goBack() {
// this.$emit('refresh')
// },
clearData() { clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll)) this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
}, },
@ -724,6 +725,7 @@ export default {
}, },
// //
dataFormSubmit(type) { dataFormSubmit(type) {
debugger
this.dataFormSubmitType = type ? type : 0 this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => { this.$refs['formRef'].validate((valid) => {
if (valid) { if (valid) {
@ -733,6 +735,7 @@ export default {
}) })
}, },
request() { request() {
debugger
let _data = this.dataList() let _data = this.dataList()
if (this.dataFormSubmitType == 2) { if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true this.continueBtnLoading = true

@ -998,6 +998,7 @@ export default {
} }
} }
echararr.forEach(item => { echararr.forEach(item => {
debugger
const flag = this.dataForm.warehousingStorageProductList.find(e => e.productId == item.productId && e.storageUnit == item.unit && e.storageNumber == item.netWeight) const flag = this.dataForm.warehousingStorageProductList.find(e => e.productId == item.productId && e.storageUnit == item.unit && e.storageNumber == item.netWeight)
if (!flag) { if (!flag) {
this.$message({ this.$message({

Loading…
Cancel
Save